code: public JSType getRestrictedUnion(JSType type) {
      UnionTypeBuilder restricted = UnionTypeBuilder.create(registry);
      for (int i = 0; i < alternates.size(); i++) {
        JSType t = alternates.get(i);
        // Keep all unknown/unresolved types.
        if (t.isUnknownType() || t.isNoResolvedType() || !t.isSubtypeOf(type)) {
          restricted.addAlternate(t);
        }
      }
      return restricted.build();
    }
docs: Returns a more restricted union type than {@code this} one, in which all
  subtypes of {@code type} have been removed.<p>
  
  Examples:
  <ul>
  <li>{@code (number,string)} restricted by {@code number} is
  {@code string}</li>
  <li>{@code (null, EvalError, URIError)} restricted by
  {@code Error} is {@code null}</li>
  </ul>
  
  @param type the supertype of the types to remove from this union type