MaterialDesignIcons { @NotNull @VisibleForTesting static Collection<String> getCategoriesFromJar(@NotNull ZipFile jar) { return jar.stream() .map(MaterialDesignIcons::getCategory) .filter(Objects::nonNull) .sorted() .collect(Collectors.toList()); } private  MaterialDesignIcons(); @Nullable static String getPathForBasename(@NotNull String basename); @NotNull static Collection<String> getCategories(); @NotNull static List<String> getIconNames(@NotNull String categoryName); @NotNull static URL getIcon(@NotNull String iconName, @NotNull String categoryName); @NotNull static URL getDefaultIcon();  }
@Test public void getCategoriesFromJar() { JarFile jar = Mockito.mock(JarFile.class); Mockito.when(jar.stream()).thenReturn(Stream.of( new JarEntry("images/material_design_icons/alert/"), new JarEntry("images/material_design_icons/action/ic_3d_rotation_black_24dp.xml"), new JarEntry("images/material_design_icons/action/"), new JarEntry("images/material_design_icons/"))); Object actual = MaterialDesignIcons.getCategoriesFromJar(jar); assertEquals(Arrays.asList("action", "alert"), actual); }