TypeConstraint (TypeConstraintFactory factory) { Set<Exact> instanceOf = ContainerUtil.map2LinkedSet(myInstanceOf, exact -> exact.convert(factory)); Set<Exact> notInstanceOf = ContainerUtil.map2LinkedSet(myNotInstanceOf, exact -> exact.convert(factory)); return new Constrained(instanceOf, notInstanceOf); }