RateLimiterConfig implements Serializable { public static Builder custom() { return new Builder(); } private  RateLimiterConfig(Duration timeoutDuration, Duration limitRefreshPeriod,
        int limitForPeriod, boolean writableStackTraceEnabled); static Builder custom(); static Builder from(RateLimiterConfig prototype); static RateLimiterConfig ofDefaults(); Duration getTimeoutDuration(); Duration getLimitRefreshPeriod(); int getLimitForPeriod(); boolean isWritableStackTraceEnabled(); @Override String toString();  }
@Test public void builderTimeoutIsNull() throws Exception { exception.expect(NullPointerException.class); exception.expectMessage(TIMEOUT_DURATION_MUST_NOT_BE_NULL); RateLimiterConfig.custom() .timeoutDuration(null); }
@Test public void builderRefreshPeriodIsNull() throws Exception { exception.expect(NullPointerException.class); exception.expectMessage(REFRESH_PERIOD_MUST_NOT_BE_NULL); RateLimiterConfig.custom() .limitRefreshPeriod(null); }
@Test public void builderRefreshPeriodTooShort() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("RefreshPeriod is too short"); RateLimiterConfig.custom() .timeoutDuration(TIMEOUT) .limitRefreshPeriod(Duration.ZERO) .limitForPeriod(LIMIT) .build(); }
@Test public void builderLimitIsLessThanOne() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("LimitForPeriod should be greater than 0"); RateLimiterConfig.custom() .limitForPeriod(0); }