### Question:
TagsBuilder { public T withTags(String... tags) { for (int i = 0; i < tags.length; i += 2) { extraTags.add(new BasicTag(tags[i], tags[i + 1])); } return (T) this; } protected  TagsBuilder(); T withTag(String k, String v); T withTag(String k, Boolean v); T withTag(String k, Enum<E> v); T withTag(Tag t); T withTags(String... tags); T withTags(Tag... tags); T withTags(Iterable<Tag> tags); T withTags(Map<String, String> tags);  }### Answer:
@Test public void varargTags() { Id id = new Builder() .withTags(new BasicTag("k1", "v1"), new BasicTag("k2", "v2")) .build(); Assertions.assertEquals(newId("k1", "v1", "k2", "v2"), id); }
@Test public void iterableTags() { Id id = new Builder() .withTags(newId("k1", "v1", "k2", "v2").tags()) .build(); Assertions.assertEquals(newId("k1", "v1", "k2", "v2"), id); }
@Test public void mapTags() { Map<String, String> tags = new HashMap<>(); tags.put("k1", "v1"); tags.put("k2", "v2"); Id id = new Builder() .withTags(tags) .build(); Assertions.assertEquals(newId("k1", "v1", "k2", "v2"), id); }
@Test public void varargStrings() { Id id = new Builder() .withTags("k1", "v1", "k2", "v2") .build(); Assertions.assertEquals(newId("k1", "v1", "k2", "v2"), id); }