### Question:
FileSystemUtil { @Nonnull public static URL parseUrl(@Nonnull final String s, @Nullable final Configuration conf) { URI uri = URI.create(s); if (uri.getScheme() == null) { uri = ((conf != null) ? FileSystem.getDefaultUri(conf) : URI.create("file: } if (!IGNORED_PROTOCOLS.contains(uri.getScheme())) { uri = URI.create("hadoop:" + uri); } try { return uri.toURL(); } catch (final MalformedURLException e) { throw new IllegalArgumentException(e); } } private  FileSystemUtil(); static boolean fileExists(@Nonnull final URI uri, @Nonnull final Configuration conf); @Nonnull static URL parseUrl(@Nonnull final String s, @Nullable final Configuration conf); static void registerFileSystems(@Nonnull final Iterable<FileSystem> fileSystems, @Nonnull final Configuration conf);  }### Answer:
@Test public void parseUrl() throws MalformedURLException { final Configuration conf = new Configuration(false); conf.set("fs.defaultFS", "mock: Assert.assertEquals(new URL("file:/path/file.ext"), FileSystemUtil.parseUrl("/path/file.ext", null)); Assert.assertEquals(new File("file.ext").toURI().toURL(), FileSystemUtil.parseUrl("file.ext", null)); Assert.assertEquals(new URL("hadoop:mock:/path/file.ext"), FileSystemUtil.parseUrl("/path/file.ext", conf)); Assert.assertEquals(new URL("http: Assert.assertEquals(new URL("hadoop:hdfs: }