### Question:
StringLiteral extends Literal { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StringLiteral that = (StringLiteral) o; return Objects.equals(value, that.value); } StringLiteral(NodeLocation location, String value); private  StringLiteral(Optional<NodeLocation> location, String value); String getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { NodeLocation nodeLocation = new NodeLocation(1, 1); StringLiteral stringLiteral1 = new StringLiteral(nodeLocation, "foo"); StringLiteral stringLiteral2 = new StringLiteral(nodeLocation, "bar"); Assert.assertTrue(stringLiteral1.equals(stringLiteral1)); Assert.assertFalse(stringLiteral1.equals(null)); Assert.assertFalse(stringLiteral1.equals("foo")); Assert.assertFalse(stringLiteral1.equals(stringLiteral2)); }