Criteria { public Map<String, String> parameters() { Map<String, String> ret = new HashMap<String, String>(); if (getTransaction() != null) { ret.put("transaction", getTransaction()); } if (getStartTime() > 0) { ret.put("startTime", "" + getStartTime()); } if (getEndTime() > 0) { ret.put("endTime", "" + getEndTime()); } if (!getProperties().isEmpty()) { boolean first = true; StringBuilder buf = new StringBuilder(); for (PropertyCriteria pc : getProperties()) { if (first) { first = false; } else { buf.append(','); } buf.append(pc.encoded()); } ret.put("properties", buf.toString()); } if (hostName != null) { ret.put("hostName", hostName); } if (!getCorrelationIds().isEmpty()) { boolean first = true; StringBuilder buf = new StringBuilder(); for (CorrelationIdentifier cid : getCorrelationIds()) { if (first) { first = false; } else { buf.append(','); } buf.append(cid.getScope().name()); buf.append('|'); buf.append(cid.getValue()); } ret.put("correlations", buf.toString()); } if (uri != null) { ret.put("uri", uri); } if (operation != null) { ret.put("operation", operation); } if (log.isLoggable(Level.FINEST)) { log.finest("Criteria parameters [" + ret + "]"); } return ret; } Criteria();  Criteria(Criteria criteria); long getStartTime(); Criteria setStartTime(long startTime); long calculateStartTime(); long getEndTime(); Criteria setEndTime(long endTime); long calculateEndTime(); String getTransaction(); Criteria setTransaction(String name); Set<PropertyCriteria> getProperties(); Criteria setProperties(Set<PropertyCriteria> properties); Criteria addProperty(String name, String value, Operator operator); Set<CorrelationIdentifier> getCorrelationIds(); Criteria setCorrelationIds(Set<CorrelationIdentifier> correlationIds); String getHostName(); Criteria setHostName(String hostName); long getUpperBound(); void setUpperBound(long upperBound); long getLowerBound(); void setLowerBound(long lowerBound); String getUri(); Criteria setUri(String uri); String getOperation(); Criteria setOperation(String operation); long getTimeout(); void setTimeout(long timeout); int getMaxResponseSize(); void setMaxResponseSize(int maxResponseSize); Map<String, String> parameters(); boolean transactionWide(); Criteria deriveTransactionWide(); @Override String toString();  }
@Test public void testGetQueryParametersNoCriteria() { Criteria criteria = new Criteria(); Map<String, String> queryParameters = criteria.parameters(); assertNotNull(queryParameters); assertTrue("Empty map expected", queryParameters.isEmpty()); }