ExitingTimeManager implements TimeManager { @Override public int getMsec() { assert player.shouldKeepRunning() == false; if (slicesRemaining == 0) { rollover = 0; return 0; } if (slicesRemaining < SLICE_COUNT && confidenceBestVsRest() > 0.99) { rollover = slicesRemaining * msecPerSlice; return 0; } slicesRemaining--; return msecPerSlice; } ExitingTimeManager(Player player); @Override int getMsec(); @Override void setRemainingSeconds(int seconds); @Override void startNewTurn();  }
@Test public void testCompareRest() { player.setRemainingTime(10000); SearchNode root = player.getRoot(); assertNotEquals(0, manager.getMsec()); root.update(coords.at("a5"), 1000, 1000); assertEquals(0, manager.getMsec(), .01); }