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