RobotsURIBuilder { @Nonnull public RobotsURIBuilder withHost(@Nonnull String host) { checkNotNull(host, "host is null"); checkArgument(!host.isEmpty(), "host userInfo"); this.host = Optional.of(IDN.toASCII(host)); 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 givenNullHost_whenWithHost_thenThrowsNPE() { builder.withHost(null); }
@Test(expected = IllegalArgumentException.class) public void givenEmptyHost_whenWithHost_thenThrowsIAE() { builder.withHost(""); }