code: public static <K, V> Map<K, V> constrainedMap(
        Map<K, V> map, MapConstraint<? super K, ? super V> constraint) {
      return new ConstrainedMap<K, V>(map, constraint);
    }
docs: Returns a constrained view of the specified map, using the specified
  constraint. Any operations that add new mappings will call the provided
  constraint. However, this method does not verify that existing mappings
  satisfy the constraint.
  
  <p>The returned map is not serializable.
  
  @param map the map to constrain
  @param constraint the constraint that validates added entries
  @return a constrained view of the specified map