DiskSpaceCheckerBuilder { private DiskSpaceChecker buildClusterChecker(Environment environment, List<String> servers) { final ClusterDiskSpaceManager clusterManager = new ClusterDiskSpaceManager(new LinkedHashSet<>(servers)); environment.jersey().register(new SetSpaceResource(clusterManager)); environment.healthChecks().register("Cluster disk manager", new ClusterDiskSpaceManagerHealthCheck(clusterManager)); return new ClusterDiskSpaceChecker(clusterManager); } DiskSpaceCheckerBuilder(Environment environment, Client client, DiskSpaceConfiguration configuration); @SuppressWarnings("unchecked") DiskSpaceChecker build();  }
@Test public void buildClusterChecker() throws Exception { configuration.setCheckerType(DiskSpaceConfiguration.CLUSTER_CHECKER); configuration.getConfiguration().put(ClusterDiskSpaceChecker.CLUSTER_SERVERS_CONFIG_OPTION, Arrays.asList("localhost", "192.168.0.100")); DiskSpaceChecker checker = builder.build(); assertThat(checker).isNotNull(); assertThat(checker).isInstanceOf(ClusterDiskSpaceChecker.class); verify(jersey).register(isA(SetSpaceResource.class)); verify(healthChecks).register(isA(String.class), isA(ClusterDiskSpaceManagerHealthCheck.class)); }