code: private static boolean canDisplayColumns(List<TerminalString> displayList, int numRows, int terminalWidth) {
  
          int numColumns = displayList.size() / numRows;
          if (displayList.size() % numRows > 0) {
              numColumns++;
          }
  
          int[] columnSizes = calculateColumnSizes(displayList, numColumns, numRows, terminalWidth);
  
          int totalSize = 0;
          for (int columnSize : columnSizes) {
              totalSize += columnSize;
          }
          return totalSize <= terminalWidth;
      }
docs: Decides if it's possible to format provided Strings into calculated number of columns while the output will not exceed
  terminal width
  
  @param displayList
  @param numRows
  @param terminalWidth
  @return true if it's possible to format strings to columns and false otherwise.