### Question:
MimeTypeFilter { public static boolean matches(@Nullable String mimeType, @NonNull String filter) { if (mimeType == null) { return false; } final String[] mimeTypeParts = mimeType.split("/"); final String[] filterParts = filter.split("/"); return mimeTypeAgainstFilter(mimeTypeParts, filterParts); } private  MimeTypeFilter(); static boolean matches(@Nullable String mimeType, @NonNull String filter); @Nullable static String matches(
            @Nullable String mimeType, @NonNull String[] filters); @Nullable static String matches(
            @Nullable String[] mimeTypes, @NonNull String filter); @NonNull static String[] matchesMany(
            @Nullable String[] mimeTypes, @NonNull String filter);  }### Answer:
@Test public void matchesBasic() throws Exception { assertTrue(MimeTypeFilter.matches("image/jpeg", "*jpeg")); assertFalse(MimeTypeFilter.matches("ImAgE/JpEg", "iMaGe*")); assertFalse(MimeTypeFilter.matches((String) null, "image/")); assertFalse(MimeTypeFilter.matches((String) null, "image/jpeg")); assertFalse(MimeTypeFilter.matches((String) null, "**")); assertFalse(MimeTypeFilter.matches("image/", "*", "*/*")); }
@Test public void matchesManyFilters() throws Exception { assertEquals("**"})); assertEquals("image*", MimeTypeFilter.matches( "image/jpeg", new String[] {"not/matching", "*jpeg", MimeTypeFilter.matches( "image/jpeg", new String[] {"*/png", "*/jpeg"})); assertNull(MimeTypeFilter.matches("image/jpeg", new String[] {})); assertNull(MimeTypeFilter.matches("image/jpeg", new String[] {"image/png", "video/jpeg"})); assertNull(MimeTypeFilter.matches("image/jpeg", new String[] {"video/jpeg", "image/png"})); assertNull(MimeTypeFilter.matches(null, new String[] {"**" })); assertNull(MimeTypeFilter.matches("", new String[] { "**" })); assertNull(MimeTypeFilter.matches("*/", new String[] { "*/*" })); }