ContractHandler { public void checkContracts() { World world = WorldManager.getInstance().getWorld(); int currentDay = world.getTimeManager().getDays(); for (Map.Entry<Contract, Integer> currentContract : currentContracts .entrySet()) { int startDay = currentContract.getValue(); int interval = currentContract.getKey().getInterval(); if (currentDay - (startDay + interval) == 0) { notifyUser("Contract Due"); fulfilContract(currentContract.getKey()); currentContract.setValue(currentDay); } else if ((startDay + interval) - currentDay == 1) { LOGGER.info("Contract Due Tomorrow"); notifyUser("A Contract Is Due Tomorrow"); } } }  Boolean addContract(Contract contract); Hashtable<Contract, Integer> getContracts(); void checkContracts(); void removeContract(Contract contract); int getDeliveryDate(Contract contract); Contract getContract(int index);  }
@Ignore @Test public void checkContractsTest() { final SimpleResourceHandler crops = SimpleResourceHandler.getInstance(); Contract a = new Contract("Business", crops.apple, 20, 0, 0, 400, 200, "Crop description", 20); activeContracts.addContract(a); activeContracts.checkContracts(); assertTrue("table is empty", activeContracts.getContracts().isEmpty()); }