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