### Question:
HttpRequestBuilder { public HttpRequestBuilder withHeader(String name, String rawValue) { ImmutableHeader header = new ImmutableHeader( checkNotNull(name,"Header name cannot be null"), checkNotNull(rawValue,"Header raw value cannot be null"), Lists.<ImmutableElement>newArrayList()); if(!this.headers.contains(header)) { this.headers.add(header); } return this; } private  HttpRequestBuilder(); HttpRequestBuilder withMethod(HttpMethod method); HttpRequestBuilder withProtocolVersion(ProtocolVersion version); HttpRequestBuilder withHost(String host); HttpRequestBuilder withAbsolutePath(String absolutePath); HttpRequestBuilder withBody(String entity); HttpRequestBuilder withHeader(String name, String rawValue); HttpRequestBuilder withServerDate(Date date); HttpRequestBuilder withClientDate(Date date); HttpRequest build(); static HttpRequestBuilder newInstance();  }### Answer:
@Test(expected=NullPointerException.class) public void testHeaderNameCannotBeNull(){ sut().withHeader(null,"value"); }
@Test(expected=NullPointerException.class) public void testHeaderRawValueCannotBeNull(){ sut().withHeader("name",null); }
@Test public void testWithHeader(){ String name = "name"; String rawValue = "value"; HttpRequest build = sut().withHeader(name,rawValue).build(); assertThat(build.headers(),hasSize(1)); assertThat(build.headers().get(0).name(),equalTo("name")); assertThat(build.headers().get(0).rawValue(),equalTo("value")); assertThat(build.headers().get(0).elements(),hasSize(0)); }