### Question:
Interval { public Interval union(Interval other) { if (this.isEmpty()) return other; if (other.isEmpty()) return this; int start = Math.min(this.start(), other.start()); int end = Math.max(this.end(), other.end()); int actualStart = Math.min(this.start, other.start); int actualEnd = Math.max(this.end, other.end); return new Interval(start, (actualStart & 1) == 0, end, (actualEnd & 1) != 0); } 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 testUnion() { assertEquals(Interval.ofClosedClosed(1, 9), Interval.ofClosedOpen(1, 3).union(Interval.ofOpenClosed(7, 9))); }