PartialHealthCheckStrategy implements HealthCheckStrategy { @Override public boolean updateHealth(Endpoint endpoint, double health) { final double unhealthyScore = 0; requireNonNull(endpoint, "endpoint"); if (!candidates.contains(endpoint)) { unhealthyEndpoints.remove(endpoint); return true; } if (health > unhealthyScore) { unhealthyEndpoints.remove(endpoint); return false; } unhealthyEndpoints.add(endpoint); synchronized (selectedEndpoints) { return removeAndSelectNewEndpoints(ImmutableSet.of(endpoint)); } } PartialHealthCheckStrategy(EndpointLimitingFunction endpointLimitingFunction); @Override void updateCandidates(List<Endpoint> candidates); @Override List<Endpoint> getSelectedEndpoints(); @Override boolean updateHealth(Endpoint endpoint, double health);  }
@Test void updateHealthWhenEndpointIsHealthy() { final Endpoint endpoint = candidatesForMaxRatio.get(1); assertThat(maxRatioStrategy.updateHealth(endpoint, HEALTHY)).isFalse(); }