private static List < ConnectionNotation > getAllSelfCycleConnections ( List < ConnectionNotation > connections ) { List < ConnectionNotation > listSelfCycle = new ArrayList < ConnectionNotation > ( ) ; for ( ConnectionNotation connection : connections ) { if ( ( connection . getTargetId ( ) . getId ( ) . equals ( connection . getSourceId ( ) . getId ( ) ) ) ) { listSelfCycle . add ( connection ) ; } } return listSelfCycle ; }
method to get all self - cycle Connections