### Question:
Formats extends Static { public static String getDisplayName(final ImageReaderWriterSpi provider) { String name = null; if (provider != null) { String[] formats = provider.getFormatNames(); if (formats != null) { for (final String candidate : formats) { int d = candidate.length(); if (d != 0) { if (name != null) { d -= name.length(); } if (d >= 0) { if (d == 0) { int na=0, nb=0; for (int i=candidate.length(); --i>=0;) { if (Character.isUpperCase(candidate.charAt(i))) na++; if (Character.isUpperCase(name .charAt(i))) nb++; } if (na <= nb) { continue; } } name = candidate; } } } } if (name == null) { formats = provider.getMIMETypes(); if (formats != null) { for (final String candidate : formats) { final int length = candidate.length(); if (length != 0 && (name == null || length < name.length())) { name = candidate; } } } } } return name; } private  Formats(); static void selectImageReader(final Object input, final Locale locale, final ReadCall callback); static ImageReaderSpi getReaderByFormatName(final String format,
            final Class<? extends ImageReaderSpi> exclude); static ImageWriterSpi getWriterByFormatName(final String format,
            final Class<? extends ImageWriterSpi> exclude); static String getDisplayName(final ImageReaderWriterSpi provider); static String[] simplify(String... choices); static void formatDescription(final IIOServiceProvider spi, final Locale locale,
            final StringBuilder appendTo); static ImageInputStream createUncachedImageInputStream(final Object input);  }### Answer:
@Test public void testGetDisplayName() { final ImageReaderSpi spi = Formats.getReaderByFormatName("png", null); assertNotNull("Not allowed to return null.", spi); assertEquals("PNG", Formats.getDisplayName(spi)); }