Engine { public void evaluate(Plan plan) throws TexeraException { HashMap<String, ISink> sinkMap = plan.getSinkMap(); if (sinkMap != null) { ISink root; for (HashMap.Entry<String, ISink> entry : sinkMap.entrySet()) { root = entry.getValue(); root.open(); root.processTuples(); root.close(); } } } private  Engine(); static Engine getEngine(); void evaluate(Plan plan);  }
@Test public void testEvaluate() throws Exception { Mockito.when(plan.getSinkMap()).thenReturn(sinkMap); sinkMap = new HashMap<>(); engine.evaluate(plan); Mockito.verify(plan).getSinkMap(); }