### Question:
DefaultPlaceholderId implements PlaceholderId { @Override public DefaultPlaceholderId withTagFactories(Iterable<TagFactory> factories) { return createNewId(sorter -> sorter.addFactories(factories)); } DefaultPlaceholderId(String name, Registry registry); private  DefaultPlaceholderId(String name, Collection<TagFactory> tagFactories, Registry registry); @Override String name(); @Override DefaultPlaceholderId withTag(String k, String v); @Override DefaultPlaceholderId withTag(Tag t); @Override DefaultPlaceholderId withTags(Iterable<Tag> tags); @Override DefaultPlaceholderId withTags(Map<String, String> tags); @Override DefaultPlaceholderId withTagFactory(TagFactory factory); @Override DefaultPlaceholderId withTagFactories(Iterable<TagFactory> factories); @Override Id resolveToId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testWithTagFactories() { Tag tags1 = new BasicTag("k1", "v1"); Tag tags2 = new BasicTag("k2", "v2"); List<TagFactory> factories = Arrays.asList(new ConstantTagFactory(tags1), new ConstantTagFactory(tags2)); DefaultPlaceholderId id = new DefaultPlaceholderId("foo", REGISTRY).withTagFactories(factories); Iterator<Tag> tags = id.resolveToId().tags().iterator(); Assertions.assertTrue(tags.hasNext(), "tags empty"); Assertions.assertEquals(tags1, tags.next()); Assertions.assertEquals(tags2, tags.next()); }