code: public static ComplexType checkIsComplexType(Type type) {
          if (!isComplexType(type)) {
              throw new ODataSystemException("A complex type is required, but '" + type.getFullyQualifiedName() +
                      "' is not a complex type: " + type.getMetaType());
          }
          return (ComplexType) type;
      }
docs: Checks if the specified OData type is a complex type and throws an exception if it is not.
  
  @param type The OData type.
  @return The OData type.
  @throws ODataSystemException If the OData type is not a complex type.