### Question:
ConstantTagFactory implements TagFactory { @Override public Tag createTag() { return tag; } 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 testCreateTagUsingTagConstructor() throws Exception { Tag expected = new BasicTag("key", "value"); TagFactory factory = new ConstantTagFactory(expected); Tag actual = factory.createTag(); Assertions.assertSame(expected, actual); }
@Test public void testCreateTagUsingKeyValueConstructor() throws Exception { String expectedKey = "key"; String expectedValue = "value"; TagFactory factory = new ConstantTagFactory(expectedKey, expectedValue); Tag actual = factory.createTag(); Assertions.assertEquals(expectedKey, actual.key()); Assertions.assertEquals(expectedValue, actual.value()); }