### Question:
Endpoint { @Override public String toString() { String boundType = this.boundType == BoundType.OPEN ? "OPEN" : "CLOSED"; return "Endpoint<" + this.value + ", " + boundType + ">"; } Endpoint(T value, BoundType boundType); T getValue(); BoundType getBoundType(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); String toLeftString(); String toRightString();  }### Answer:
@Test public void testToString() { assertEquals("Endpoint<1, OPEN>", openEndpoint.toString()); assertEquals("Endpoint<2, CLOSED>", closedEndpoint.toString()); assertEquals("(1", openEndpoint.toLeftString()); assertEquals("[2", closedEndpoint.toLeftString()); assertEquals("1)", openEndpoint.toRightString()); assertEquals("2]", closedEndpoint.toRightString()); }