code: private List getEntityObjects(Class clazz, final EntityMetadata entityMetadata, EntityType entityType,
              SearchHits hits)
      {
          List results = new ArrayList();
  
          Object entity = null;
          for (SearchHit hit : hits.getHits())
          {
              entity = KunderaCoreUtils.createNewInstance(clazz);
              Map<String, Object> hitResult = hit.sourceAsMap();
              results.add(wrap(hitResult, entityType, entity, entityMetadata, false));
          }
  
          return results;
      }
docs: Gets the entity objects.
  
  @param clazz
  the clazz
  @param entityMetadata
  the entity metadata
  @param entityType
  the entity type
  @param hits
  the hits
  @return the entity objects