code: public static void validateTargetType(Object entity, ODataRequest request, EntityDataModel entityDataModel,
                                            ODataUri oDataUri) throws ODataProcessorException, ODataTargetTypeException {
          if (!entityDataModel.getType(
                  entity.getClass()).getFullyQualifiedName().equals(getTargetType(request, entityDataModel,
                  oDataUri).typeName())) {
              throw new ODataProcessorException(PROCESSOR_ERROR,
                      "Entity to persist does not match specified Resource name");
          }
      }
docs: Validates the target type.
  
  @param entity an entity
  @throws com.sdl.odata.api.processor.ODataProcessorException
  @throws com.sdl.odata.api.processor.datasource.ODataTargetTypeException