RobotsUtilities { @Nonnull public URI getRobotsURIForResource(@Nonnull final URI resourceUri) { checkNotNull(resourceUri, "resourceUri"); try { return new RobotsURIBuilder() .fromUri(resourceUri) .build(); } catch (RuntimeException e) { throw new IllegalArgumentException("Failed to derive robots.txt location from malformed URI: " + resourceUri, e); } }  @Nonnull URI getRobotsURIForResource(@Nonnull final URI resourceUri); @Nonnull String getResourceLocalComponents(@Nonnull URI resourceUri);  }
@Test(expected = IllegalArgumentException.class) public void givenMalformedResourceURI_whenGetRobotsURIForResource_thenThrowsIAE() { URI resourceUri = URI.create("http: utilities.getRobotsURIForResource(resourceUri); }
@Test(expected = IllegalArgumentException.class) public void givenAnotherMalformedResourceURI_whenGetRobotsURIForResource_thenThrowsIAE() { URI resourceUri = URI.create("http: utilities.getRobotsURIForResource(resourceUri); }