private List<Node> createNodeListFromDataItems(List<?> dataItems,Node parent){
  List<Node> result=new ArrayList<>();
  if (dataItems != null) {
    for (    Object dataItem : dataItems) {
      boolean isExpandable=isExpandable(dataItem);
      Node node=new Node(dataItem,parent);
      node.setExpandable(isExpandable);
      if (mView.isAlwaysExpanded() && isExpandable) {
        node.setSubNodes(createNodeListFromDataItems(getSubObjects(node.getObject()),node));
      }
      result.add(node);
    }
  }
  return result;
}

private List < Node > createNodeListFromDataItems ( List < ? > dataItems , Node parent ) { List < Node > result = new ArrayList < > ( ) ; if ( dataItems != null ) { for ( Object dataItem : dataItems ) { boolean isExpandable = isExpandable ( dataItem ) ; Node node = new Node ( dataItem , parent ) ; node . setExpandable ( isExpandable ) ; if ( mView . isAlwaysExpanded ( ) && isExpandable ) { node . setSubNodes ( createNodeListFromDataItems ( getSubObjects ( node . getObject ( ) ) , node ) ) ; } result . add ( node ) ; } } return result ; }
creates list of nodes for data items provided to adapter .
