code: @Override
  	public <T> Optional<T> queryForObject(String collection, Query query, Class<T> clazz, RequestMethod method) {
  
  		Assert.notNull(collection, "Collection must not be null!");
  		Assert.notNull(query, "Query must not be 'null'.");
  		Assert.notNull(clazz, "Target class must not be 'null'.");
  
  		query.setPageRequest(PageRequest.of(0, 1));
  		QueryResponse response = querySolr(collection, query, clazz, method);
  
  		if (response.getResults().size() > 0) {
  			if (response.getResults().size() > 1) {
  				LOGGER.warn("More than 1 result found for singe result query ('{}'), returning first entry in list", query);
  			}
  			return Optional.ofNullable(convertSolrDocumentListToBeans(response.getResults(), clazz).get(0));
  		}
  		return Optional.empty();
  	}
docs: /*
  (non-Javadoc)
  @see org.springframework.data.solr.core.SolrOperations#queryForObject(org.springframework.data.solr.core.query.Query, java.lang.Class, org.springframework.data.solr.core.RequestMethod)