private List<ExpandableWrapper<P,C>> generateFlattenedParentChildList(List<P> parentList){
  List<ExpandableWrapper<P,C>> flatItemList=new ArrayList<>();
  int parentCount=parentList.size();
  for (int i=0; i < parentCount; i++) {
    P parent=parentList.get(i);
    generateParentWrapper(flatItemList,parent,parent.isInitiallyExpanded());
  }
  return flatItemList;
}

private List < ExpandableWrapper < P , C > > generateFlattenedParentChildList ( List < P > parentList ) { List < ExpandableWrapper < P , C > > flatItemList = new ArrayList < > ( ) ; int parentCount = parentList . size ( ) ; for ( int i = 0 ; i < parentCount ; i ++ ) { P parent = parentList . get ( i ) ; generateParentWrapper ( flatItemList , parent , parent . isInitiallyExpanded ( ) ) ; } return flatItemList ; }
generates a full list of all parents and their children , in order .
