FileNameExtractor { static String extractFrom(String assetUrl) { String[] subPaths = assetUrl.split(PATH_SEPARATOR); return subPaths.length == 0 ? assetUrl : subPaths[subPaths.length - 1]; } private  FileNameExtractor();   }
@Test public void returnsFileName_whenAssetUrlOnlyContainsFileName() { String assetUrl = "10MB.zip"; String fileName = FileNameExtractor.extractFrom(assetUrl); assertThat(fileName).isEqualTo("10MB.zip"); }
@Test public void returnsFileName_whenAssetUrlContainsSubdirectories() { String assetUrl = "foo/bar/10MB.zip"; String fileName = FileNameExtractor.extractFrom(assetUrl); assertThat(fileName).isEqualTo("10MB.zip"); }