### Question:
PartialOrderedSet extends HashSet<E> { public boolean allowsABeforeB(final E a, final E b) { Set<E> transitiveClosure = this.getTransitiveClosure(b); return !transitiveClosure.contains(a); } 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);  }### Answer:
@Test public void testAllowsABeforeB() { assertTrue(this.set.allowsABeforeB(A, B)); assertTrue(this.set.allowsABeforeB(A, C)); assertTrue(this.set.allowsABeforeB(A, D)); assertTrue(this.set.allowsABeforeB(B, C)); assertTrue(this.set.allowsABeforeB(B, D)); assertTrue(this.set.allowsABeforeB(C, D)); assertFalse(this.set.allowsABeforeB(B, A)); assertFalse(this.set.allowsABeforeB(C, A)); assertFalse(this.set.allowsABeforeB(D, A)); assertFalse(this.set.allowsABeforeB(C, B)); assertFalse(this.set.allowsABeforeB(D, B)); assertFalse(this.set.allowsABeforeB(D, C)); }