RobotsURIBuilder { @Nonnull public RobotsURIBuilder withScheme(@Nonnull String scheme) { checkNotNull(scheme, "scheme is null"); checkArgument(!scheme.isEmpty(), "empty scheme"); this.scheme = Optional.of(scheme); return this; }  @Nonnull RobotsURIBuilder withScheme(@Nonnull String scheme); @Nonnull RobotsURIBuilder withUserInfo(@Nonnull String userInfo); @Nonnull RobotsURIBuilder withHost(@Nonnull String host); @Nonnull RobotsURIBuilder withPort(int port); @Nonnull RobotsURIBuilder fromUriString(@Nonnull String uriString); @Nonnull RobotsURIBuilder fromUri(@Nonnull URI uri); @Nonnull RobotsURIBuilder fromURL(@Nonnull URL url); @Nonnull URI build();  }
@Test(expected = NullPointerException.class) public void givenNullSchema_whenWithSchema_thenThrowsNPE() { builder.withScheme(null); }
@Test(expected = IllegalArgumentException.class) public void givenEmptyScheme_whenWithScheme_thenThrowsIAE() { builder.withScheme(""); }