private void testRestSearchGeneric(Iterator<JsonNode> searchNode) {
    while (searchNode.hasNext()) {
      JsonNode search = searchNode.next();
      Assert.assertEquals(search.findValue("start").asInt(), 0);
      Assert.assertEquals(search.findValue("end").asInt(), 1);
      Assert.assertEquals(search.findValue("total").asInt(), 1);
      Assert.assertTrue(!search.findValue("summaries").isNull());
      Iterator<JsonNode> iterator = search.findValue("summaries").elements();

      while (iterator.hasNext()) {
        JsonNode node = iterator.next();
        Assert.assertEquals(node.findValue("username").asText(), "growth");
        Assert.assertEquals(node.findValue("starttime").asLong(), 1460980616502L);
        Assert.assertEquals(node.findValue("finishtime").asLong(), 1460980723925L);
        Assert.assertEquals(node.findValue("waittime").asLong(), 20);
        Assert.assertEquals(node.findValue("resourceused").asLong(), 100);
        Assert.assertEquals(node.findValue("resourcewasted").asLong(), 30);
        Assert.assertEquals(node.findValue("severity").asText(), "None");
        Assert.assertEquals(node.findValue("queue").asText(), "misc_default");

        Iterator<JsonNode> heuristicsSummary = node.findValue("heuristicsummary").elements();
        HashMap<String, String> expectedHeuristics = new LinkedHashMap<String, String>();
        expectedHeuristics.put("Mapper Skew", "None");
        expectedHeuristics.put("Mapper GC", "None");
        expectedHeuristics.put("Mapper Time", "None");
        expectedHeuristics.put("Mapper Speed", "None");
        expectedHeuristics.put("Mapper Spill", "None");
        expectedHeuristics.put("Mapper Memory", "None");
        expectedHeuristics.put("Reducer Skew", "None");
        expectedHeuristics.put("Reducer Time", "None");
        expectedHeuristics.put("Reducer GC", "None");
        expectedHeuristics.put("Reducer Memory", "None");
        expectedHeuristics.put("Shuffle & Sort", "None");

        Iterator<String> keyIterator = expectedHeuristics.keySet().iterator();
        while (heuristicsSummary.hasNext() && keyIterator.hasNext()) {
          JsonNode job = heuristicsSummary.next();
          String key = keyIterator.next().toString();
          Assert.assertEquals(key, job.findValue("name").asText());
          Assert.assertEquals(expectedHeuristics.get(key), job.findValue("severity").asText());
        }
      }
    }
  }
<p>
Rest API  - Provides data for plotting the flow history graph for time and resources
</p>
test/rest/RestAPITest.java