code: private List<Entity> runQuery(Query query) throws DatastoreException {
      RunQueryRequest.Builder request = RunQueryRequest.newBuilder();
      request.setQuery(query);
      RunQueryResponse response = datastore.runQuery(request.build());
  
      if (response.getBatch().getMoreResults() == QueryResultBatch.MoreResultsType.NOT_FINISHED) {
        System.err.println("WARNING: partial results\n");
      }
      List<EntityResult> results = response.getBatch().getEntityResultsList();
      List<Entity> entities = new ArrayList<Entity>(results.size());
      for (EntityResult result : results) {
        entities.add(result.getEntity());
      }
      return entities;
    }
docs: Run a query on the datastore.
  
  @return The entities returned by the query.
  @throws DatastoreException on error