Header extends NameValue { static Header valueOf(String value) { String[] parts = value.split(":", 2); if (parts != null) { if (parts.length == 1) { return new Header(parts[0].trim(), ""); } else if (parts.length == 2) { return new Header(parts[0].trim(), parts[1].trim()); } } throw new IllegalArgumentException("Not a valid header string"); } Header(String name, String value);  Header(String name, Directives directives); @Override final String toString(); Directives getDirectives();  }
@Test public void valueOfMustAllowDateValuesToBeSet() { Header header = Header.valueOf("Expires:Wed, 05 Oct 2011 22:00:00 GMT"); Assert.assertEquals("Expires", header.getName()); Assert.assertEquals("Wed, 05 Oct 2011 22:00:00 GMT", header.getValue()); }