RobotsConfig { public void setMaxRedirectHops(@Nonnegative int maxRedirectHops) { checkArgument(maxRedirectHops >= 0, "maxRedirectHops is negative"); this.maxRedirectHops = maxRedirectHops; }  long getRequestTimeoutMillis(); void setRequestTimeoutMillis(@Nonnegative long requestTimeoutMillis); int getReadTimeoutMillis(); void setReadTimeoutMillis(@Nonnegative int readTimeoutMillis); @Nonnull String getUserAgent(); void setUserAgent(@Nonnull String userAgent); @Nonnull Charset getDefaultCharset(); void setDefaultCharset(@Nonnull Charset defaultCharset); @Nonnegative int getMaxRedirectHops(); void setMaxRedirectHops(@Nonnegative int maxRedirectHops); @Nonnegative long getCacheExpiresHours(); void setCacheExpiresHours(@Nonnegative long cacheExpiresHours); @Nonnegative long getCacheMaxSizeRecords(); void setCacheMaxSizeRecords(@Nonnegative long cacheMaxSizeRecords); @Nonnegative int getMaxFileSizeBytes(); void setMaxFileSizeBytes(@Nonnegative int maxFileSizeBytes); @Override @Nonnull String toString();  }
@Test(expected = IllegalArgumentException.class) public void givenNegativeValue_whenSetMaxRedirectHops_thenThrowsIAE() { final int maxRedirectHops = -1; config.setMaxRedirectHops(maxRedirectHops); }