CharsetHolder implements Comparable<CharsetHolder> { public boolean isSupported() { try { return Charset.isSupported(this.charset); } catch (IllegalCharsetNameException icne) { logger.debug("Illegal charset requested.", icne); return false; } } CharsetHolder(final String charset, final float quality, final int order); String getCharset(); float getQuality(); int getOrder(); boolean isSupported(); static CharsetHolder getFirstSupportedCharset(final String acceptCharsetHeaderValue); static List<CharsetHolder> getAcceptableCharsets(final String acceptCharsetHeaderValue); int compareTo(final CharsetHolder charsetHolder); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void isSupportedValid() { CharsetHolder charset = new CharsetHolder("UTF-8", 1, 1); Assert.assertTrue(charset.isSupported()); }
@Test public void isSupportedInvalid() { CharsetHolder charset = new CharsetHolder("junk", 1, 1); Assert.assertFalse(charset.isSupported()); }