class PartialOrderedSet extends HashSet<E> {

	public void addABeforeB(final E a, final E b) {
		if (!this.allowsABeforeB(a, b)) {
			throw new IllegalStateException("By transitivity " + a + " before " + b + "isn't allowed.");
		}
		if (!this.contains(a)) {
			this.add(a);
		}
		if (!this.contains(b)) {
			this.add(b);
		}
		Set<E> directlyAfterA = this.order.computeIfAbsent(a, k -> new HashSet<>());
		directlyAfterA.add(b);
	}

	public  PartialOrderedSet(final PartialOrderedSet<E> original);
	public  PartialOrderedSet();

}