code: private static <K, V> Collection<Entry<K, V>> constrainedEntries(
        Collection<Entry<K, V>> entries, MapConstraint<? super K, ? super V> constraint) {
      if (entries instanceof Set) {
        return constrainedEntrySet((Set<Entry<K, V>>) entries, constraint);
      }
      return new ConstrainedEntries<K, V>(entries, constraint);
    }
docs: Returns a constrained view of the specified collection (or set) of entries,
  using the specified constraint. The {@link Entry#setValue} operation will
  be verified with the constraint, along with add operations on the returned
  collection. The {@code add} and {@code addAll} operations simply forward to
  the underlying collection, which throws an {@link
  UnsupportedOperationException} per the map and multimap specification.
  
  @param entries the entries to constrain
  @param constraint the constraint for the entries
  @return a constrained view of the specified entries