HarvestAgentMemoryChecker extends MemoryChecker { protected void onSetWarning() { super.onSetWarning(); harvestAgent.setMemoryWarning(true); } HarvestAgentMemoryChecker(); HarvestAgent getHarvestAgent(); void setHarvestAgent(HarvestAgent harvestAgent);  }
@Test public final void testOnSetWarning() { try { HarvestAgent ha = new MockHarvestAgent(); ha.setMemoryWarning(false); testInstance.setHarvestAgent(ha); testInstance.onSetWarning(); assertTrue(testInstance.getHarvestAgent().getMemoryWarning()); } catch(Exception e) { fail(e.getMessage()); } }