code: private <T> TypedQuery<T> onTypedQuery(Class<T> paramClass, Query q)
      {
          if (paramClass.equals(((QueryImpl) q).getKunderaQuery().getEntityClass()) || paramClass.equals(Object.class))
          {
              return new KunderaTypedQuery<T>(q);
          }
  
          throw new IllegalArgumentException("Mismatch in expected return type. Expected:" + paramClass
                  + " But actual class is:" + ((QueryImpl) q).getKunderaQuery().getEntityClass());
      }
docs: Validates if expected result class is matching with supplied one, else
  throws {@link IllegalArgumentException}
  
  @param <T>
  object type
  @param paramClass
  expected result class
  @param q
  query
  @return typed query instance.