code: private static int[] groupedSizes(int[][] groups, int[] rawSizes) {
          // Return the compressed sizes if there are no groups.
          if (groups == null || groups.length == 0) {
              return rawSizes;
          }
  
          // Initialize the result with the given compressed sizes.
          int[] sizes = new int[rawSizes.length];
          for (int i = 0; i < sizes.length; i++) {
              sizes[i] = rawSizes[i];
          }
  
          // For each group equalize the sizes.
          for (int[] groupIndices : groups) {
              int groupMaxSize = 0;
              // Compute the group's maximum size.
              for (int groupIndice : groupIndices) {
                  int index = groupIndice - 1;
                  groupMaxSize = Math.max(groupMaxSize, sizes[index]);
              }
              // Set all sizes of this group to the group's maximum size.
              for (int groupIndice : groupIndices) {
                  int index = groupIndice - 1;
                  sizes[index] = groupMaxSize;
              }
          }
          return sizes;
      }
docs: Computes and returns the grouped sizes. Gives grouped columns and rows the same size.
  
  @param groups	the group specification
  @param rawSizes	the raw sizes before the grouping
  @return the grouped sizes