### Question:
InvertListNumber implements ListNumber { static void fillCoords(int[] coords, int index, ListInt sizes) { for (int i = 0; i < coords.length; i++) { int revI = sizes.size() - i - 1; int size = sizes.getInt(revI); coords[revI] = index % size; index = index / size; } }    }### Answer:
@Test public void fillCoords1() { ListInt sizes = new ArrayInt(15,3,2); int[] actualCoords = new int[] {13,2,0}; int index = (13 * 3 + 2) * 2 + 0; int[] coords = new int[3]; InvertListNumber.fillCoords(coords, index, sizes); assertThat(coords, equalTo(actualCoords)); }
@Test public void fillCoords2() { ListInt sizes = new ArrayInt(15,3,2); int[] actualCoords = new int[] {10,0,1}; int index = (10 * 3 + 0) * 2 + 1; int[] coords = new int[3]; InvertListNumber.fillCoords(coords, index, sizes); assertThat(coords, equalTo(actualCoords)); }