@Test public void testEquals() throws Exception { IntSet sis = new SingletonIntSet(3); IntSet sis2 = new SingletonIntSet(4); assertNotEquals(sis, sis2); assertNotEquals(sis2, sis); IntSet sis3 = SmallIntSet.of(3); assertEquals(sis3, sis); assertEquals(sis, sis3); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return set.size() == 1 && set.contains(value); } }
SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return set.size() == 1 && set.contains(value); } } }
SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return set.size() == 1 && set.contains(value); } } SingletonIntSet(int value); }
SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return set.size() == 1 && set.contains(value); } } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterator.OfInt iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override int[] toIntArray(); @Override boolean containsAll(Collection<?> c); @Override IntStream intStream(); @Override void forEach(IntConsumer action); @Override void forEach(Consumer<? super Integer> action); @Override Spliterator.OfInt intSpliterator(); @Override Spliterator<Integer> spliterator(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return set.size() == 1 && set.contains(value); } } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterator.OfInt iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override int[] toIntArray(); @Override boolean containsAll(Collection<?> c); @Override IntStream intStream(); @Override void forEach(IntConsumer action); @Override void forEach(Consumer<? super Integer> action); @Override Spliterator.OfInt intSpliterator(); @Override Spliterator<Integer> spliterator(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }