AcceptLanguage implements QualityValue { @Override public String toString() { return RuntimeDelegate.getInstance().createHeaderDelegate(AcceptLanguage.class).toString(this); } 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 testToString() { AcceptLanguage acceptLanguage = acceptLanguage("en", "us"); when(headerDelegate.toString(acceptLanguage)).thenReturn("en-us"); assertEquals("en-us", acceptLanguage.toString()); verify(headerDelegate).toString(acceptLanguage); }