private List<Object> createObjectList(Object object,List<Object> objectList){
  if (areFiltersPassed(object) && !getExpandedState(object)) {
    if (childrenLoaded(object)) {
      expandToLevel(object,1);
    }
 else {
      if (objectList == null) {
        objectList=new ArrayList<>();
      }
      objectList.add(object);
    }
  }
  Object parent=getParentElement(object);
  if (null != parent) {
    createObjectList(parent,objectList);
  }
  return objectList;
}

private List < Object > createObjectList ( Object object , List < Object > objectList ) { if ( areFiltersPassed ( object ) && ! getExpandedState ( object ) ) { if ( childrenLoaded ( object ) ) { expandToLevel ( object , 1 ) ; } else { if ( objectList == null ) { objectList = new ArrayList < > ( ) ; } objectList . add ( object ) ; } } Object parent = getParentElement ( object ) ; if ( null != parent ) { createObjectList ( parent , objectList ) ; } return objectList ; }
constructs the list of elements that need to be expanded , so that object supplied can be visible .
