EndlessGrid implements Grid<T>, Overseer { int normalizeY(int y) { while (y < 0) { y += sizeY; } while (y >= sizeY) { y -= sizeY; } return y; } EndlessGrid(int sizeX, int sizeY, CellFactory<T> cellFactory);  EndlessGrid(Grid<T> other, CellFactory<T> cellFactory); protected  EndlessGrid(Parcel in); @Override void putCell(T cell); @Override void onCellStateChanged(CellStateChange cellStateChange); @Override int getSizeX(); @Override int getSizeY(); @Override T getCell(int x, int y); @Override boolean equals(Object o); @Override int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final Creator<EndlessGrid> CREATOR; }
@Test public void testNormalizeY() { assertThat(grid.normalizeY(7)).isEqualTo(1); }