IntegerUnion implements NumberUnion<Integer> { @Override public boolean add(Integer value) { return internalAdd(value); } IntegerUnion(int value);  IntegerUnion(int valueBegin, int valueEnd);  IntegerUnion();  IntegerUnion(int[] externalArray);  IntegerUnion(IntegerUnion externalSet);  IntegerUnion(Collection<Integer> externalCollection);  IntegerUnion(Iterator<Integer> valueIterator); @Override boolean equals(Object obj); @Override int hashCode(); @Override boolean isEmpty(); @Override String toString(); @Override boolean remove(Object o); @Override boolean add(Integer value); @Override Iterator<Integer> iterator(); List<Integer> getValueRanges(); @Override Comparator<? super Integer> comparator(); @Override SortedSet<Integer> subSet(Integer e, Integer e1); @Override SortedSet<Integer> headSet(Integer e); @Override SortedSet<Integer> tailSet(Integer e); @Override Integer first(); @Override Integer last(); @Override int size(); @Override boolean contains(Object o); @Override Object[] toArray(); @Override T[] toArray(T[] ts); @Override boolean containsAll(Collection<?> clctn); @Override boolean addAll(Collection<? extends Integer> clctn); @Override boolean retainAll(Collection<?> clctn); @Override boolean removeAll(Collection<?> clctn); @Override void clear(); ListIterator<Integer> listIterator(); ListIterator<Integer> listIterator(int from);  }
@Test public void testAdd() { IntegerUnion mergeTool = new IntegerUnion(15, 50); Assert.assertTrue(mergeTool.add(51)); check(mergeTool, new Integer[]{15, 51}); Assert.assertTrue(mergeTool.add(14)); check(mergeTool, new Integer[]{14, 51}); Assert.assertTrue(mergeTool.add(53)); check(mergeTool, new Integer[]{14, 51, 53, 53}); Assert.assertTrue(mergeTool.add(52)); check(mergeTool, new Integer[]{14, 53}); Assert.assertFalse(mergeTool.add(14)); check(mergeTool, new Integer[]{14, 53}); Assert.assertFalse(mergeTool.add(53)); check(mergeTool, new Integer[]{14, 53}); Assert.assertFalse(mergeTool.add(15)); Assert.assertFalse(mergeTool.add(52)); check(mergeTool, new Integer[]{14, 53}); Assert.assertTrue(mergeTool.add(12)); check(mergeTool, new Integer[]{12, 12, 14, 53}); }