class ZwitscherController {

    @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public HttpEntity<Collection<String>> tweets(@RequestParam(value = "q", required = false) String q) {
        Collection<String> tweets = repository.search(ofNullable(q).orElse(query), pageSize);
        return new ResponseEntity<>(tweets, HttpStatus.OK);
    }

    @Autowired public  ZwitscherController(ZwitscherRepository repository);

}