GMTimes extends TimeKeeper { public void setAllGMTimes(long... times) { Verify.nullCheck(times); String[] gms = getGMKeyArray(); int size = times.length; for (int i = 0; i < 4; i++) { if (i >= size) { setTime(gms[i], 0L); } else { setTime(gms[i], times[i]); } } } GMTimes(Map<String, Long> times, String lastState, long lastStateChange);  GMTimes(String lastState, long lastStateChange);  GMTimes(String lastState);  GMTimes(Map<String, Long> times);  GMTimes(); static String[] getGMKeyArray(); static String magicNumberToGMName(int magicNumber); Optional<String> getMostUsedGameMode(); void setAllGMTimes(long... times); void resetTimes(long time); @Override String getState();  }
@Test void allGMTimesAreSet() { GMTimes times = new GMTimes(); times.setAllGMTimes(1L, 2L, 3L, 4L); assertEquals(1L, times.getTime("SURVIVAL")); assertEquals(2L, times.getTime("CREATIVE")); assertEquals(3L, times.getTime("ADVENTURE")); assertEquals(4L, times.getTime("SPECTATOR")); }
@Test void allGMTimesAreSetWithTooFewArguments() { GMTimes times = new GMTimes(); times.setAllGMTimes(1L, 2L); assertEquals(1L, times.getTime("SURVIVAL")); assertEquals(2L, times.getTime("CREATIVE")); assertEquals(0L, times.getTime("ADVENTURE")); assertEquals(0L, times.getTime("SPECTATOR")); }
@Test void allGMTimesAreSetWithTooManyArguments() { GMTimes times = new GMTimes(); times.setAllGMTimes(1L, 2L, 3L, 4L, 5L, 6L); assertEquals(1L, times.getTime("SURVIVAL")); assertEquals(2L, times.getTime("CREATIVE")); assertEquals(3L, times.getTime("ADVENTURE")); assertEquals(4L, times.getTime("SPECTATOR")); }
@Test void stateIsRenamed() { GMTimes gmTimes = new GMTimes(); gmTimes.setAllGMTimes(5L); gmTimes.renameState("SURVIVAL", "Survival"); assertEquals(0L, gmTimes.getTime("SURVIVAL")); assertEquals(5L, gmTimes.getTime("Survival")); }