code: public static <T> JPQLQuery<T> selectDistinct(Expression<T> expr) {
          return new JPASubQuery<Void>().select(expr).distinct();
      }
docs: Create a new detached JPQLQuery instance with the given projection
  
  @param expr projection
  @param <T>
  @return select(distinct expr)