@Test
public void testPrint__maxLines() {

    // kolekcja wejsciowa
    List<Integer> list = Arrays.asList(123, 234, 345, 456, 567, 678);
    // dane testowe
    Integer[] maxArray = {
        2, 3, 4, 7
    };
    // oczekiwane wartosci
    String[] expectedResults = {
        // maxLines = 2
        Formatter.NL
        + "Integer list (6)" + Formatter.NL
        + "  1. 123" + Formatter.NL
        + "  ..." + Formatter.NL
        + "  6. 678" + Formatter.NL,
        // maxLines = 3
        Formatter.NL
        + "Integer list (6)" + Formatter.NL
        + "  1. 123" + Formatter.NL
        + "  ..." + Formatter.NL
        + "  6. 678" + Formatter.NL,
        // maxLines = 4
        Formatter.NL
        + "Integer list (6)" + Formatter.NL
        + "  1. 123" + Formatter.NL
        + "  2. 234" + Formatter.NL
        + "  ..." + Formatter.NL
        + "  6. 678" + Formatter.NL,
        // maxLines = 7
        Formatter.NL
        + "Integer list (6)" + Formatter.NL
        + "  1. 123" + Formatter.NL
        + "  2. 234" + Formatter.NL
        + "  3. 345" + Formatter.NL
        + "  4. 456" + Formatter.NL
        + "  5. 567" + Formatter.NL
        + "  6. 678" + Formatter.NL
    };
    // wykonanie testow
    for (int i = 0; i < maxArray.length; i++) {
        int maxLines = maxArray[i];
        String expectedResult = expectedResults[i];
        String result = Printer.print(list, "Integer list", maxLines, null);
        assertEquals(expectedResult, result);
    }
}