code: public static void validateArgumentRefType(Ref name, Ref.RefType type, String variableName) {
      checkNullArgument(name, variableName);
      if (name.getRefType() != type) {
        throw new IllegalArgumentException(ExceptionMessageMap.getMessage("100000")
            + "  { variableName=[" + variableName + "] }");
      }
    }
docs: Checks a <code>Ref</code> argument to make sure that it is of given <code>refType</code> type.
  If not <code>IllegalArgumentException</code> is thrown.
  
  @param name
  The argument to check.
  @param type
  The <code>refType</code> to check against.
  @param variableName
  The name of the variable being checked; for use in exception messages.