@Test
public void list() throws RestException {

    SiddhiHandler siddhiHandler = new SiddhiHandler();
    // Build the list of execution plans
    List<Map<String, Object>> executionPlans = new ArrayList<>();
    // Build the first execution plan
    Map<String, Object> executionPlanMap = new HashMap<>();
    Map<String, String> outputTopics = new HashMap<>();
    outputTopics.put("testOutput", "outputTopic");
    executionPlanMap.put("id", "testID");
    executionPlanMap.put("input", Arrays.asList("test", "test2"));
    executionPlanMap.put("output", outputTopics);
    executionPlanMap.put("executionPlan", "from test select a insert into testOutput");
    executionPlanMap.put("version", 0);
    executionPlanMap.put("filters", Collections.emptyMap());
    executionPlans.add(executionPlanMap);
    // Build the second execution plan
    Map<String, Object> executionPlanMap2 = new HashMap<>();
    Map<String, String> outputTopics2 = new HashMap<>();
    outputTopics2.put("testOutput", "outputTopic");
    executionPlanMap2.put("id", "testID2");
    executionPlanMap2.put("input", Arrays.asList("test", "test2"));
    executionPlanMap2.put("output", outputTopics2);
    executionPlanMap2.put("executionPlan", "from test select d insert into testOutput");
    executionPlanMap2.put("version", 0);
    executionPlanMap2.put("filters", Collections.emptyMap());
    executionPlans.add(executionPlanMap2);
    // Add both to siddhiHandler
    siddhiHandler.synchronize(executionPlans);
    // Check that both lists are equal
    assertTrue(executionPlans.containsAll(siddhiHandler.list()));
    assertTrue(siddhiHandler.list().containsAll(executionPlans));
}