InstanceCache { static InstanceCache newInstance(AgentManagementConfiguration configuration, InstanceCloudConnector connector, Set<String> knownInstanceGroups, Registry registry, int bootRetryCount, long bootRetryDelayMs, Scheduler scheduler) { return new InstanceCache(configuration, connector, knownInstanceGroups, registry, bootRetryCount, bootRetryDelayMs, scheduler); } private  InstanceCache(AgentManagementConfiguration configuration,
                          InstanceCloudConnector connector,
                          Set<String> knownInstanceGroups,
                          Registry registry,
                          int bootRetryCount,
                          long bootRetryDelayMs,
                          Scheduler scheduler);   }
@Test public void testBootstrapWithKnownInstanceGroupsAndConnectorTimeout() { String id1 = testConnector.takeInstanceGroup(0).getId(); String id2 = testConnector.takeInstanceGroup(1).getId(); testConnector.addInterceptor(id1, id -> { throw new RuntimeException("Simulated connector error"); }); try { cache = InstanceCache.newInstance(configuration, testConnector, asSet(id1, id2), registry, 1, 1, Schedulers.computation()); } catch (AgentManagementException e) { assertThat(e.getErrorCode()).isEqualTo(ErrorCode.InitializationError); } }