@RestMethod(method = HttpMethod.GET, template = "") public List<TestTeamPojo> getTeams( @QueryParameter(name = "teamType") @Description("Identifies the team type.") String teamType, @QueryParameter(name = "teamName") String teamName, @QueryParameter(name = "city") String cities[]) { List<TestTeamPojo> result = new ArrayList<TestTeamPojo>(); for (TestTeamPojo team : teams) { boolean match = true; if (!StringUtils.isEmpty(teamType)) if (!teamType.equals(team.getType().name())) match = false; if (!StringUtils.isEmpty(teamName)) if (!teamName.equals(team.getName())) match = false; if (cities.length > 0) { boolean found = false; for (String city : cities) { if (!StringUtils.isEmpty(city)) if (city.equals(team.getCity())) found = true; } if (!found) match = false; } if (match == true) result.add(team); } lastMethodCalled = "getTeams"; lastHttpMethodCalled = "GET"; return result; }