code: private static void checkType(String typeName, QName type) {
          if (!typeName.equals(type.getLocalPart())) {
              throw new IllegalArgumentException(
                      "requires "+typeName+" instead of "+type.getLocalPart()
                      );
          }
      }
docs: utilities