### Question:
ConstantTagFactory implements TagFactory { @Override public String name() { return tag.key(); } ConstantTagFactory(String key, String value);  ConstantTagFactory(Tag tag); @Override String name(); @Override Tag createTag(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testNameFromTag() throws Exception { String expected = "factoryName"; Tag tag = new BasicTag(expected, "unused"); TagFactory factory = new ConstantTagFactory(tag); Assertions.assertEquals(expected, factory.name()); }
@Test public void testNameFromKey() throws Exception { String expected = "factoryName"; TagFactory factory = new ConstantTagFactory(expected, "unused"); Assertions.assertEquals(expected, factory.name()); }