### Question:
ApiQuery extends NeutralQuery { @Override public String toString() { StringBuilder stringBuffer = new StringBuilder("offset=" + getOffset() + "&limit=" + getLimit()); if (getIncludeFields() != null) { stringBuffer.append("&includeFields=" + StringUtils.join(getIncludeFields(), ",")); } if (getExcludeFields() != null) { stringBuffer.append("&excludeFields=" + StringUtils.join(getExcludeFields(), ",")); } if (getSortBy() != null) { stringBuffer.append("&sortBy=" + getSortBy()); } if (getSortOrder() != null) { stringBuffer.append("&sortOrder=" + getSortOrder()); } if (this.selector != null) { stringBuffer.append("&selector=" + this.toSelectorString(this.selector)); } for (NeutralCriteria neutralCriteria : getCriteria()) { stringBuffer.append("&" + neutralCriteria.getKey() + neutralCriteria.getOperator() + neutralCriteria.getValue()); } return stringBuffer.toString(); } ApiQuery(UriInfo uriInfo);  ApiQuery(String entityType, URI requestURI);  ApiQuery(URI requestURI);  ApiQuery(); @Override String toString(); Map<String, Object> getSelector(); void setSelector(Map<String, Object> selector); String getEntityType(); static final int API_QUERY_DEFAULT_LIMIT; static final Map<String, Object> DEFAULT_SELECTOR; }### Answer:
@Test public void testToString() throws URISyntaxException { List<String> equivalentStrings = new ArrayList<String>(); equivalentStrings.add("offset=0&limit=50"); equivalentStrings.add("offset=0&limit=50"); equivalentStrings.add("offset=0&limit=50"); equivalentStrings.add("offset=0&limit=50"); URI requestUri = new URI(URI_STRING); when(uriInfo.getRequestUri()).thenReturn(requestUri); ApiQuery apiQuery = new ApiQuery(uriInfo); assertTrue(equivalentStrings.contains(apiQuery.toString())); }