@Test
public void testToJson() throws Exception {

    UserResults<Search> response = new UserResults<>("api2demo");
    response.items = new ArrayList<>();
    response.username = "test";
    response.itemsCount = (long) 1;
    Search search = new Search();
    search.id = 1l;
    search.query = "*:*";
    search.queryString = "http://localhost:8080*:0&start=1";
    search.dateSaved = Date.from(Instant.now());
    response.items.add(search);
    try {
        ModelAndView modelAndView = JsonUtils.toJson(response, null);
        assertNotNull(modelAndView);
    } catch (Exception e) {
        fail(e.getMessage());
    }
}