### Question:
MetricsProcessor extends ApiDataListener { public Integer[] getContextIds() { return metricsContexts.keySet().toArray(new Integer[0]); } private  MetricsProcessor(); int addContext(); static MetricsProcessor getInstance(); @Override void processData(List<String> jsonData); boolean removeContext(int id); MetricsData getMetricsData(int id); boolean resetMetricsData(int id); Integer[] getContextIds(); String getEnvironment();  }### Answer:
@Test public void getContextIdsTest() { Integer ids[] = mp.getContextIds(); int size = ids.length; int contextId = mp.addContext(); ids = mp.getContextIds(); assertEquals(size + 1, ids.length); boolean found = false; for(Integer i : ids) { if (i == contextId) { found = true; } } assertTrue("New context should exist", found); mp.removeContext(contextId); ids = mp.getContextIds(); assertEquals(size, ids.length); found = false; for(Integer i : ids) { if (i == contextId) { found = true; } } assertFalse("Deleted context should not exist", found); }