public void updateGroupSizes(){
  int ungroupedCount=0;
  Group currentGroup=null;
  int count=0;
  for (int i=0; i < listModel.getSize(); i++) {
    Group group=listModel.getElementAt(i);
    if (group.isGroupHeader()) {
      if (currentGroup == null)       ungroupedCount=count;
 else {
        if (Objects.equals(currentGroup.getGroupId(),NOT_GROUPED))         currentGroup.setSize(count + ungroupedCount);
 else         currentGroup.setSize(count);
      }
      count=0;
      currentGroup=group;
    }
 else     count++;
  }
  if (count > 0 && currentGroup != null) {
    if (Objects.equals(currentGroup.getGroupId(),NOT_GROUPED))     currentGroup.setSize(count + ungroupedCount);
 else     currentGroup.setSize(count);
  }
}

public void updateGroupSizes ( ) { int ungroupedCount = 0 ; Group currentGroup = null ; int count = 0 ; for ( int i = 0 ; i < listModel . getSize ( ) ; i ++ ) { Group group = listModel . getElementAt ( i ) ; if ( group . isGroupHeader ( ) ) { if ( currentGroup == null ) ungroupedCount = count ; else { if ( Objects . equals ( currentGroup . getGroupId ( ) , NOT_GROUPED ) ) currentGroup . setSize ( count + ungroupedCount ) ; else currentGroup . setSize ( count ) ; } count = 0 ; currentGroup = group ; } else count ++ ; } if ( count > 0 && currentGroup != null ) { if ( Objects . equals ( currentGroup . getGroupId ( ) , NOT_GROUPED ) ) currentGroup . setSize ( count + ungroupedCount ) ; else currentGroup . setSize ( count ) ; } }
updates the group size
