question: private void createInsertList ( final IItem item , List < IItem > tempList , List < IItem > insertList , int depth , int removed ) { if ( ! tempList . contains ( item ) ) { tempList . add ( item ) ; if ( depth == 0 ) { insertList . add ( item ) ; } if ( item . getItems ( ) != null ) { depth ++ ; for ( IItem child : item . getItems ( ) ) { createInsertList ( child , tempList , insertList , depth , removed ) ; } } } else { insertList . remove ( item ) ; removed ++ ; } }
target:  Recursive helper method for createInsertList