code: private static int getBytesSize(ArrayList<String> arr) {
          int count=0;
          
          for (String str : arr) {
              count = count + str.length();
          }
          return count;
      }
docs: Utility function to calculate the total number of bytes in
  an array of Strings. This method assumes that the strings
  only contain single-byte characters (i.e. 1 char = 1 byte).
  @param arr
  @return total number of bytes