### Question:
StateSplitter { public static State split(int state) { return new State((int)(Math.floor(state / 1000000.0) % 1000), (int)(Math.floor(state / 1000.0) % 1000), state % 1000); }  static State split(int state);  }### Answer:
@Test public void itShouldSplitState() throws Exception { assertState(0, 0, 0, StateSplitter.split(0)); assertState(0, 0, 1, StateSplitter.split(1)); assertState(0, 0, 999, StateSplitter.split(999)); assertState(0, 1, 0, StateSplitter.split(1000)); assertState(0, 999, 0, StateSplitter.split(999000)); assertState(1, 0, 0, StateSplitter.split(1000000)); assertState(999, 0, 0, StateSplitter.split(999000000)); assertState(999, 999, 999, StateSplitter.split(999999999)); assertState(0, 0, 0, StateSplitter.split(1000000000)); }