### Question:
DefaultId implements Id { @Override public String toString() { return name + tags; } DefaultId(String name);   DefaultId(String name, ArrayTagSet tags); @Override String name(); @Override Iterable<Tag> tags(); @Override DefaultId withTag(Tag tag); @Override DefaultId withTag(String key, String value); @Override DefaultId withTags(String... ts); @Override DefaultId withTags(Tag... ts); @Override DefaultId withTags(Iterable<Tag> ts); @Override DefaultId withTags(Map<String, String> ts); @Override String getKey(int i); @Override String getValue(int i); @Override int size(); @Override Id filter(BiPredicate<String, String> predicate); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testToString() { DefaultId id = (new DefaultId("foo")).withTag("k1", "v1").withTag("k2", "v2"); Assertions.assertEquals("foo:k1=v1:k2=v2", id.toString()); }
@Test public void testToStringNameOnly() { DefaultId id = new DefaultId("foo"); Assertions.assertEquals(id.toString(), "foo"); }