protected TwoLevelExpandableAdapter(List<T> data,List<Boolean> state){
  fullData=data;
  dataList=new ArrayList<>();
  isOpen=new ArrayList<>(state);
  for (int i=0; i < fullData.size(); i++) {
    T headerGroup=fullData.get(i);
    dataList.add(new DataHolder(headerGroup.getData(),ItemType.HEADER));
    if (isOpen.get(i)) {
      for (      Object item : headerGroup.getChildren()) {
        dataList.add(new DataHolder(item,ItemType.ITEM));
      }
    }
  }
}

protected TwoLevelExpandableAdapter ( List < T > data , List < Boolean > state ) { fullData = data ; dataList = new ArrayList < > ( ) ; isOpen = new ArrayList < > ( state ) ; for ( int i = 0 ; i < fullData . size ( ) ; i ++ ) { T headerGroup = fullData . get ( i ) ; dataList . add ( new DataHolder ( headerGroup . getData ( ) , ItemType . HEADER ) ) ; if ( isOpen . get ( i ) ) { for ( Object item : headerGroup . getChildren ( ) ) { dataList . add ( new DataHolder ( item , ItemType . ITEM ) ) ; } } } }
return adapter whose items will be expanded according to state
