private int currentThreadCount() {
    return Thread.getAllStackTraces().keySet().size();
  }
Using Awaitility will increase total thread count by 1: ConditionAwaiter$ConditionPoller.
geode-core/src/integrationTest/java/org/apache/geode/distributed/LocatorLauncherJmxManagerLocalRegressionTest.java