code: public static Type getAndCheckType(EntityDataModel entityDataModel, Class<?> javaType) {
          Type type = entityDataModel.getType(javaType);
          if (type == null) {
              throw new ODataSystemException("No type found in the entity data model for Java type: "
                      + javaType.getName());
          }
          return type;
      }
docs: Gets the OData type for a Java type and throws an exception if there is no OData type for the Java type.
  
  @param entityDataModel The entity data model.
  @param javaType        The Java type.
  @return The OData type for the Java type.
  @throws ODataSystemException If there is no OData type for the specified Java type.