code: private static List<Integer> getMaxColumnSizes(List<String[]> resultSet) {
      List<Integer> maxColumnSizes = Lists.newArrayList();
      for (int i = 0; i < resultSet.get(0).length; i++) {
        int maxColumnSize = -1;
        for (int j = 0; j < resultSet.size(); j++) {
          if (resultSet.get(j)[i].length() > maxColumnSize) {
            maxColumnSize = resultSet.get(j)[i].length();
          }
        }
        maxColumnSizes.add(maxColumnSize);
      }
      return maxColumnSizes;
    }
docs: Gets a list of the maximum size for each column.
  
  @param resultSet the result set to process
  @return a list of the maximum size for each column