public InternalDistributedSystem build() {
      if (securityConfig == null) {
        securityConfig = new SecurityConfig(null, null);
      }

      boolean stopThreads = true;
      InternalDataSerializer.checkSerializationVersion();
      try {
        SystemFailure.startThreads();
        InternalDistributedSystem newSystem =
            new InternalDistributedSystem(new ConnectionConfigImpl(
                configProperties), defaultStatisticsManagerFactory(),
                FunctionStatsManager::new);
        newSystem
            .initialize(securityConfig.getSecurityManager(), securityConfig.getPostProcessor(),
                metricsServiceBuilder, locator, clusterDistributionManagerConstructor);
        notifyConnectListeners(newSystem);
        stopThreads = false;
        return newSystem;
      } finally {
        if (stopThreads) {
          SystemFailure.stopThreads();
        }
      }
    }
Builds and initializes new instance of InternalDistributedSystem.
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java