### Question:
Interval { public Interval translate(int amount) { int start = this.start() + amount; int end = this.end() + amount; return new Interval(start, this.isStartClosed(), end, this.isEndClosed()); } private  Interval(int start, boolean startInclusive, int end, boolean endInclusive); static Interval ofOpenOpen(int start, int end); static Interval ofOpenClosed(int start, int end); static Interval ofClosedOpen(int start, int end); static Interval ofClosedClosed(int start, int end); boolean isStartClosed(); boolean isEndClosed(); boolean isEmpty(); boolean isBefore(int point); boolean contains(int point); boolean isAfter(int point); Interval intersect(Interval other); Interval union(Interval other); Interval prefix(Interval other); Interval suffix(Interval other); Interval translate(int amount); Interval translateNegative(int amount); int size(); int start(); int end(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testTranslate() { Interval iv = Interval.ofOpenOpen(2, 42); assertEquals(Interval.ofOpenOpen(5, 45), iv.translate(3)); assertEquals(Interval.ofOpenOpen(1, 41), iv.translateNegative(1)); }