PartialHealthCheckStrategyBuilder { PartialHealthCheckStrategyBuilder maxEndpointRatio(double maxEndpointRatio) { if (maxEndpointCount != null) { throw new IllegalArgumentException("Maximum endpoint count is already set."); } checkArgument(maxEndpointRatio > 0 && maxEndpointRatio <= 1, "maxEndpointRatio: %s (expected: 0 < maxEndpointRatio <= 1)", maxEndpointRatio); this.maxEndpointRatio = maxEndpointRatio; return this; }    }
@Test void maxEndpointRatioWhenLessThanEqual0() { assertThrows(IllegalArgumentException.class, () -> builder.maxEndpointRatio(0)); }