### Question:
ConfigurationUtils { static URL getResourceUrl(String resourceLocation) throws FileNotFoundException { Objects.requireNonNull(resourceLocation, "Resource location must not be null"); URL resourceUrl; if (resourceLocation.startsWith(CLASSPATH_URL_PREFIX)) { resourceUrl = getClasspathResourceUrl(resourceLocation.substring(CLASSPATH_URL_PREFIX.length())); } else { try { resourceUrl = new URL(resourceLocation); } catch (MalformedURLException e) { resourceUrl = getClasspathResourceUrl(resourceLocation); } } return resourceUrl; } private  ConfigurationUtils();   }### Answer:
@Test public void shouldThrowFileNotFoundOnInvalidResources() { assertThatExceptionOfType(FileNotFoundException.class) .isThrownBy(() -> ConfigurationUtils.getResourceUrl("idontexists")); }
@Test public void protocollessUrlsShouldBeTreatedAsClasspathUrls() throws FileNotFoundException { URL url = ConfigurationUtils.getResourceUrl("some.properties"); assertThat(url).isNotNull(); }
@Test public void absoluteUrlsShouldWorkWith() throws FileNotFoundException { URL url = ConfigurationUtils.getResourceUrl("/some.properties"); assertThat(url).isNotNull(); }
@Test public void classpathUrlsShouldWork() throws FileNotFoundException { URL url = ConfigurationUtils.getResourceUrl("classpath:some.properties"); assertThat(url).isNotNull(); }
@Test public void absoluteUrlsShouldWorkWithProtocol() throws FileNotFoundException { URL url = ConfigurationUtils.getResourceUrl("classpath:/some.properties"); assertThat(url).isNotNull(); }
@Test public void fileUrlsShouldWork() throws IOException { Path path = Files.createTempFile("ResourceUtilsTest", ".properties"); URL url = ConfigurationUtils.getResourceUrl(path.toUri().toURL().toString()); assertThat(url).isNotNull(); }
@Test public void shouldThrowFileNotFoundOnInvalidUrls() { assertThatExceptionOfType(FileNotFoundException.class) .isThrownBy(() -> ConfigurationUtils.getResourceUrl("invalid: }