ServiceCachingPolicyBuilder { public ServiceCachingPolicyBuilder withMaxNumServiceInstancesPerEndPoint(int maxNumServiceInstancesPerEndPoint) { checkState(maxNumServiceInstancesPerEndPoint >= 0); _maxNumServiceInstancesPerEndPoint = maxNumServiceInstancesPerEndPoint; return this; }  static ServiceCachingPolicy getMultiThreadedClientPolicy(); ServiceCachingPolicyBuilder withMaxNumServiceInstances(int maxNumServiceInstances); ServiceCachingPolicyBuilder withMaxNumServiceInstancesPerEndPoint(int maxNumServiceInstancesPerEndPoint); ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit); ServiceCachingPolicyBuilder withCacheExhaustionAction(ExhaustionAction action); ServiceCachingPolicy build(); static final ServiceCachingPolicy NO_CACHING; }
@Test(expected = IllegalStateException.class) public void testInvalidMaxNumServiceInstancesPerEndPoint() { ServiceCachingPolicyBuilder builder = new ServiceCachingPolicyBuilder(); builder.withMaxNumServiceInstancesPerEndPoint(-1); }