### Question:
RangeOperations { public RangeList<T> or(Range<T> r1, Range<T> r2) { RangeList<T> rangeList = new RangeList<>(); if (checkDiscrete(r1, r2)) { rangeList.addAllRanges(r1, r2); return rangeList; } else { T min = r1.getMin().compareTo(r2.getMin()) < 0 ? r1.getMin() : r2.getMin(); T max = r1.getMax().compareTo(r2.getMax()) < 0 ? r2.getMax() : r1.getMax(); rangeList.addRange(new Range<T>(min, max)); return rangeList; } }  RangeList<T> and(Range<T> r1, Range<T> r2); RangeList<T> or(Range<T> r1, Range<T> r2); RangeNode<T> processFilterItem(FilterItem filterItem, String table, String columnName); RangeNode<T> rangeNodeOr(RangeNode<T> left, RangeNode<T> right); RangeNode<T> rangeNodeAnd(RangeNode<T> left, RangeNode<T> right); @SuppressWarnings("unchecked") RangeNode<T> processRangeNodes(RangeNode<?> left, RangeNode<?> right, LogicalOperation logicalOperation); abstract T getValue(String valueString); abstract T getMinValue(); abstract T getMaxValue(); abstract T add(T value, int step); abstract T subtract(T value, int step);  }### Answer:
@Test public void testDiscreteOr() { Range<Long> range1 = new Range<>(1l, 3l); Range<Long> range2 = new Range<Long>(4l, 5l); RangeList<Long> orRange = rangeOperations.or(range1, range2); RangeList<Long> expectedRangeList = new RangeList<>(); expectedRangeList.addAllRanges(new Range<Long>(1l, 3l), new Range<Long>(4l, 5l)); assertEquals(expectedRangeList, orRange); }
@Test public void testOverlappingOr() { Range<Long> range1 = new Range<>(1l, 3l); Range<Long> range2 = new Range<Long>(2l, 5l); RangeList<Long> orRange = rangeOperations.or(range1, range2); RangeList<Long> expectedRangeList = new RangeList<>(); expectedRangeList.addAllRanges(new Range<Long>(1l, 5l)); assertEquals(expectedRangeList, orRange); }
@Test public void testEdgeCaseOr() { Range<Long> range1 = new Range<>(1l, 3l); Range<Long> range2 = new Range<Long>(3l, 5l); RangeList<Long> orRange = rangeOperations.or(range1, range2); RangeList<Long> expectedRangeList = new RangeList<>(); expectedRangeList.addAllRanges(new Range<Long>(1l, 5l)); assertEquals(expectedRangeList, orRange); }
@Test public void testOrOperatorWithReverseRange() { Range<Long> range1 = new Range<>(10l, 12l); Range<Long> range2 = new Range<>(7l, 11l); RangeList<Long> result = rangeOperations.or(range1, range2); RangeList<Long> expected = new RangeList<>(); expected.addAllRanges(new Range<>(7l, 12l)); assertEquals(result, expected); }