### Question:
DefaultHttpHeaders extends HttpHeaders { @Override public HttpHeaders set(HttpHeaders headers) { if (headers instanceof DefaultHttpHeaders) { this.headers.set(((DefaultHttpHeaders) headers).headers); return this; } else { return super.set(headers); } } DefaultHttpHeaders();  DefaultHttpHeaders(boolean validate); protected  DefaultHttpHeaders(boolean validate, NameValidator<CharSequence> nameValidator); protected  DefaultHttpHeaders(DefaultHeaders<CharSequence, CharSequence, ?> headers); @Override HttpHeaders add(HttpHeaders headers); @Override HttpHeaders set(HttpHeaders headers); @Override HttpHeaders add(String name, Object value); @Override HttpHeaders add(CharSequence name, Object value); @Override HttpHeaders add(String name, Iterable<?> values); @Override HttpHeaders add(CharSequence name, Iterable<?> values); @Override HttpHeaders addInt(CharSequence name, int value); @Override HttpHeaders addShort(CharSequence name, short value); @Override HttpHeaders remove(String name); @Override HttpHeaders remove(CharSequence name); @Override HttpHeaders set(String name, Object value); @Override HttpHeaders set(CharSequence name, Object value); @Override HttpHeaders set(String name, Iterable<?> values); @Override HttpHeaders set(CharSequence name, Iterable<?> values); @Override HttpHeaders setInt(CharSequence name, int value); @Override HttpHeaders setShort(CharSequence name, short value); @Override HttpHeaders clear(); @Override String get(String name); @Override String get(CharSequence name); @Override Integer getInt(CharSequence name); @Override int getInt(CharSequence name, int defaultValue); @Override Short getShort(CharSequence name); @Override short getShort(CharSequence name, short defaultValue); @Override Long getTimeMillis(CharSequence name); @Override long getTimeMillis(CharSequence name, long defaultValue); @Override List<String> getAll(String name); @Override List<String> getAll(CharSequence name); @Override List<Entry<String, String>> entries(); @Deprecated @Override Iterator<Map.Entry<String, String>> iterator(); @Override Iterator<Entry<CharSequence, CharSequence>> iteratorCharSequence(); @Override Iterator<String> valueStringIterator(CharSequence name); @Override Iterator<CharSequence> valueCharSequenceIterator(CharSequence name); @Override boolean contains(String name); @Override boolean contains(CharSequence name); @Override boolean isEmpty(); @Override int size(); @Override boolean contains(String name, String value, boolean ignoreCase); @Override boolean contains(CharSequence name, CharSequence value, boolean ignoreCase); @Override Set<String> names(); @Override boolean equals(Object o); @Override int hashCode(); @Override HttpHeaders copy();  }### Answer:
@Test(expected = NullPointerException.class) public void testSetNullHeaderValueValidate() { HttpHeaders headers = new DefaultHttpHeaders(true); headers.set(of("test"), (CharSequence) null); }
@Test(expected = NullPointerException.class) public void testSetNullHeaderValueNotValidate() { HttpHeaders headers = new DefaultHttpHeaders(false); headers.set(of("test"), (CharSequence) null); }
@Test public void setCharSequences() { final DefaultHttpHeaders headers = newDefaultDefaultHttpHeaders(); headers.set(HEADER_NAME, HeaderValue.THREE.asList()); assertDefaultValues(headers, HeaderValue.THREE); }
@Test public void setIterable() { final DefaultHttpHeaders headers = newDefaultDefaultHttpHeaders(); headers.set(HEADER_NAME, HeaderValue.THREE.asList()); assertDefaultValues(headers, HeaderValue.THREE); }
@Test public void setObjectObjects() { final DefaultHttpHeaders headers = newDefaultDefaultHttpHeaders(); headers.set(HEADER_NAME, HeaderValue.THREE.asList()); assertDefaultValues(headers, HeaderValue.THREE); }
@Test public void setObjectIterable() { final DefaultHttpHeaders headers = newDefaultDefaultHttpHeaders(); headers.set(HEADER_NAME, HeaderValue.THREE.asList()); assertDefaultValues(headers, HeaderValue.THREE); }