code: private AbstractRESTEntity asEntity(byte[] responseBody, Class<?> clazz)
          throws Exception {
  
          AbstractRESTEntity entity = null;
  
          entity = (AbstractRESTEntity) mapper.readValue(responseBody, clazz);
  
          return entity;
      }
docs: Convert a byte array to an importer REST entity.