### Question:
Header implements AnyRequestModifier { public DateTime asDateTime() { return new Rfc1123DateMatcher().getDateTime(this.getValue()); } Header(String name, String value);  Header(String nameAndValue); String getName(); String getValue(); @Override void applyTo(ServerDriverHttpUriRequest request); @Override String toString(); DateTime asDateTime(); @Generated("Eclipse") @Override int hashCode(); @Generated("Eclipse") @Override boolean equals(Object object);  }### Answer:
@Test public void asDateTimeReturnsCorrectDate() { Header dateHeader = new Header("HELLO: Mon, 09 May 2011 18:49:18 GMT"); DateTime headerDate = dateHeader.asDateTime(); assertThat(headerDate.getDayOfWeek(), is(DateTimeConstants.MONDAY)); assertThat(headerDate.getDayOfMonth(), is(9)); assertThat(headerDate.getMonthOfYear(), is(DateTimeConstants.MAY)); assertThat(headerDate.getYear(), is(2011)); assertThat(headerDate.getHourOfDay(), is(18)); assertThat(headerDate.getMinuteOfHour(), is(49)); assertThat(headerDate.getSecondOfMinute(), is(18)); }
@Test(expected = RuntimeDateFormatException.class) public void asDateTimeThrowsIfNotCorrectFormat() { Header dateHeader = new Header("HELLO: XXX, 09 May 2011 18:49:18 GMT"); dateHeader.asDateTime(); }