TetrisFigure implements Figure, Cloneable { public Figure rotate(int times) { int realRotates = times % 4; for (int i = 0; i < realRotates; i++) { performRotate(); } return this; } @Deprecated  TetrisFigure(); @Deprecated  TetrisFigure(int centerX, int centerY, String... rows);  TetrisFigure(int centerX, int centerY, Type type, String... rows); int getLeft(); int getRight(); int getTop(); int getBottom(); @Override int[] getRowCodes(boolean ignoreColors); Figure rotate(int times); @Override int getWidth(); @Override Figure getCopy(); @Override Type getType(); public String[] rows; }
@Test(timeout = 1000) public void shouldRotateWhenOverflowTimes() { TetrisFigure figure = new TetrisFigure(1, 1, " #", "# ", " #"); figure.rotate(Integer.MAX_VALUE); }