HazelcastStateRepository implements StateRepository { public static Builder newBuilder() { return new Builder(); } HazelcastStateRepository(Config hazelcastConfig, String mapName);  HazelcastStateRepository(ClientConfig hazelcastClientConfig, String mapName);  HazelcastStateRepository(HazelcastInstance hazelcastInstance, String mapName); private  HazelcastStateRepository(Builder builder); @Override FeatureState getFeatureState(final Feature feature); @Override void setFeatureState(final FeatureState featureState); static Builder newBuilder(); static Builder newBuilder(String mapName);  }
@Test void onlyConfigSetBuildsSuccessfully() { HazelcastStateRepository stateRepository = HazelcastStateRepository.newBuilder() .config(new Config()) .build(); assertNotNull(stateRepository); }
@Test void onlyClientConfigSetBuildsSuccessfully() { HazelcastStateRepository stateRepository = HazelcastStateRepository.newBuilder() .clientConfig(new ClientConfig()) .build(); assertNotNull(stateRepository); }
@Test void onlyHazelcastInstanceSetBuildsSuccessfully() { HazelcastStateRepository stateRepository = HazelcastStateRepository.newBuilder() .hazelcastInstance(Hazelcast.newHazelcastInstance()) .build(); assertNotNull(stateRepository); }
@Test void multipleConfiguredPiecesThrowsIllegalStateException() { assertThrows(IllegalStateException.class, () -> { HazelcastStateRepository.newBuilder() .clientConfig(new ClientConfig()) .config(new Config()) .build(); }); }