package com.vilisimo.ads.books.algorithms.chapter1;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class Exercise1110Test {

    @Test
    public void transformsTwoRowsThreeColumnsToTable() {
        //given
        var input = new boolean[2][3];
        input[0][0] = true;
        input[0][1] = false;
        input[0][2] = true;
        input[1][0] = true;
        input[1][1] = true;
        input[1][2] = true;

        //when
        var result = Exercise1110.toTable(input);

        assertThat(result, is(" 012\n0* *\n1***"));
    }

    @Test
    public void transformsThreeRowsTwoColumnsToTable() {
        //given
        var input = new boolean[3][2];

        //when
        var result = Exercise1110.toTable(input);

        assertThat(result, is(" 01\n0  \n1  \n2  "));
    }

    @Test
    public void doesNotConstructTablesForZeroWidthHeightArrays() {
        //given
        var zeroWidth = new boolean[2][0];
        var zeroHeight = new boolean[0][2];

        //when
        var wTable = Exercise1110.toTable(zeroWidth);
        var hTable = Exercise1110.toTable(zeroHeight);

        //then
        assertThat(wTable, is(""));
        assertThat(hTable, is(""));
    }
}
@@ -320,182 +320,54 @@
 ean%5B
-2
 %5D%5B
-3%5D;%0A        input%5B0%5D%5B0%5D = true;%0A        input%5B0%5D%5B1%5D = false;%0A        input%5B0%5D%5B2%5D = true;%0A        input%5B1%5D%5B0%5D = true;%0A        input%5B1%5D%5B1%5D = true;%0A        input%5B1%5D%5B2%5D =
+%5D %7B %7Btrue, false, true%7D, %7Btrue, true,
  true
+%7D%7D
 ;%0A%0A 

Use array shorthand