AcceptLanguage implements QualityValue { public static AcceptLanguage valueOf(String header) { return RuntimeDelegate.getInstance().createHeaderDelegate(AcceptLanguage.class).fromString(header); } AcceptLanguage(Language language);  AcceptLanguage(Language language, float qValue);  AcceptLanguage(Locale locale, float qValue);  AcceptLanguage(Locale locale); static AcceptLanguage valueOf(String header); Language getLanguage(); String getPrimaryTag(); String getSubTag(); Locale getLocale(); boolean isCompatible(AcceptLanguage other); boolean isCompatible(Language other); @Override float getQvalue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final AcceptLanguage DEFAULT; }
@Test public void testValueOf() { AcceptLanguage acceptLanguage = acceptLanguage("en", "us"); when(headerDelegate.fromString("en-us")).thenReturn(acceptLanguage); assertSame(acceptLanguage, AcceptLanguage.valueOf("en-us")); }