@RequestMapping(value = "/stats/all", method = RequestMethod.GET) public @ResponseBody List<CompanyStats> getStatsForCompanies( @RequestParam(value = "showActive", required = false) Boolean active) { if (active == null) { return statsService.getStatsForAllCompanies(); } return active ? statsService.getStatsForActiveCompanies() : statsService.getStatsForInactiveCompanies(); }