Class MinimalSet<E>

  • All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    @GwtCompatible
    public class MinimalSet<E>
    extends MinimalCollection<E>
    implements java.util.Set<E>
    A simplistic set which implements the bare minimum so that it can be used in tests without relying on any specific Set implementations. Slow. Explicitly allows null elements so that they can be used in the testers.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)  
      static <E> MinimalSet<E> from​(java.util.Collection<? extends E> contents)  
      int hashCode()  
      static <E> MinimalSet<E> of​(E... contents)  
      static <E> MinimalSet<E> ofClassAndContents​(java.lang.Class<? super E> type, E[] emptyArrayForContents, java.lang.Iterable<? extends E> contents)  
      • Methods inherited from class java.util.AbstractCollection

        add, isEmpty, remove, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
    • Method Detail

      • of

        public static <E> MinimalSet<E> of​(E... contents)
      • from

        public static <E> MinimalSet<E> from​(java.util.Collection<? extends E> contents)
      • ofClassAndContents

        public static <E> MinimalSet<E> ofClassAndContents​(java.lang.Class<? super E> type,
                                                           E[] emptyArrayForContents,
                                                           java.lang.Iterable<? extends E> contents)
      • equals

        public boolean equals​(java.lang.Object object)
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.Set<E>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.Set<E>
        Overrides:
        hashCode in class java.lang.Object