question: public static void insertTopic ( List < ITopic > topics , ITopic topic ) { if ( topics == null || topics . size ( ) == 0 || topics . contains ( topic ) ) { return ; } List < ITopic > allTopics = MindMapUtils . getAllTopics ( topic . getOwnedSheet ( ) , true , true ) ; int index = allTopics . indexOf ( topic ) ; for ( int i = index + 1 ; i < allTopics . size ( ) ; i ++ ) { ITopic t = allTopics . get ( i ) ; if ( topics . contains ( t ) ) { topics . add ( topics . indexOf ( t ) , topic ) ; return ; } } topics . add ( topic ) ; }
target:  if topics contain topic, return; else insert topic into List<topics> at the proper position.