code: public static <E> Set<E> constrainedSet(Set<E> set, Constraint<? super E> constraint) {
      return new ConstrainedSet<E>(set, constraint);
    }
docs: Returns a constrained view of the specified set, using the specified
  constraint. Any operations that add new elements to the set will call the
  provided constraint. However, this method does not verify that existing
  elements satisfy the constraint.
  
  <p>The returned set is not serializable.
  
  @param set the set to constrain
  @param constraint the constraint that validates added elements
  @return a constrained view of the set