### Question:
FigureImpl implements Figure, Cloneable { @Override public int[] rowCodes(boolean ignoreColors) { if (ignoreColors) { return uncoloredCodes; } return codes; } FigureImpl();  FigureImpl(int x, int y, String... rows);  FigureImpl(int x, int y, Type type, String... rows); int left(); int right(); int top(); int bottom(); @Override int[] rowCodes(boolean ignoreColors); Figure rotate(int times); @Override int width(); @Override int height(); @Override Figure copy(); @Override Type type(); @Override String toString(); public String[] rows; }### Answer:
@Test public void shouldProvideValidBinaryCodesWhenRowDefined() { assertThat(rowCodes("#")).isEqualTo(new int[]{0b001}); assertThat(rowCodes("##")).isEqualTo(new int[]{0b001001}); assertThat(rowCodes(" # ")).isEqualTo(new int[]{0b000001000}); }
@Test public void shouldProvideValidBinaryCodesWhenColDefined() { assertThat(rowCodes("#", "#")).isEqualTo(new int[]{0b001, 0b001}); assertThat(rowCodes("#", "#")).isEqualTo(new int[]{0b001, 0b001}); assertThat(rowCodes(" ", "#", " ")).isEqualTo(new int[]{0b000, 0b001, 0b000}); }
@Test public void shouldIgnoreColorCodeWhenAsked() { assertThat(rowCodes(true, "#")).isEqualTo(new int[]{0b111}); assertThat(rowCodes(true, "##")).isEqualTo(new int[]{0b111111}); assertThat(rowCodes(true, " # ")).isEqualTo(new int[]{0b000111000}); }