@Test
  public void testExceptionTooSmallWidth() {
    when(screen.getScreenWidth()).thenReturn(7);

    Table table = createTableStructure(3, "|", "A", "A", "A");
    RowGroup rowGroup = table.getLastRowGroup();
    Row row = rowGroup.newRow();
    row
        .newLeftCol("12")
        .newLeftCol("12")
        .newLeftCol("12");

    // This should throw an exception
    assertThatThrownBy(() -> validateTable(table, true))
        .isInstanceOf(TooManyColumnsException.class);
  }
Test Variations table-wide separator true false
geode-gfsh/src/test/java/org/apache/geode/management/internal/cli/result/TableBuilderTest.java