HeaderTemplate extends Template { public static HeaderTemplate from(String name, List<TemplateChunk> chunks) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name is required."); } if (chunks == null) { throw new IllegalArgumentException("chunks are required."); } return new HeaderTemplate(name, Util.UTF_8, chunks); } private  HeaderTemplate(String template, String name, Iterable<String> values, Charset charset); private  HeaderTemplate(String name, Charset charset, List<TemplateChunk> chunks); static HeaderTemplate from(String name, List<TemplateChunk> chunks); static HeaderTemplate create(String name, Iterable<String> values); static HeaderTemplate append(HeaderTemplate headerTemplate, Iterable<String> values); static HeaderTemplate appendFrom(HeaderTemplate headerTemplate,
                                          List<TemplateChunk> chunks); Collection<String> getValues(); String getName(); @Override String expand(Map<String, ?> variables);  }
@Test(expected = IllegalArgumentException.class) public void it_should_throw_exception_when_value_is_null_for_chunks() { HeaderTemplate.from("test", null); exception.expectMessage("values are required"); }