PartialOrderedSet extends HashSet<E> { public boolean isReflexive() { for (E e : this) { if (!this.order.containsKey(e)) { return false; } if (!this.order.get(e).contains(e)) { return false; } } return true; } PartialOrderedSet(final PartialOrderedSet<E> original);  PartialOrderedSet(); void addABeforeB(final E a, final E b); void requireABeforeB(final E a, final E b); boolean allowsABeforeB(final E a, final E b); Map<E, Set<E>> getOrder(); boolean isADirectlyBeforeB(final E a, final E b); Set<E> getTransitiveClosure(final E e); Set<E> getTransitiveClosure(final Set<E> subSet); boolean isReflexive(); List<E> getTotalOrder(); void merge(final PartialOrderedSet<? extends E> set); void addAll(final PartialOrderedSet<? extends E> set); @Override String toString(); List<E> getLinearization(); @Override Iterator<E> iterator(); @Override void clear(); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); @Override boolean removeIf(final Predicate<? super E> filter); @Override boolean remove(final Object e); @Override int hashCode(); @SuppressWarnings("rawtypes") @Override boolean equals(final Object obj);  }
@Test public void testIsReflexive() { assertFalse("The given set isn't refelxive, but calculation says it is.", this.set.isReflexive()); }