private static Set < Integer > find ( final Predicate < Instruction > predicate , final List < Instruction > instructions ) { final Set < Integer > positions = new HashSet <> ( ) ; for ( int i = 0 ; i < instructions . size ( ) ; i ++ ) { final Instruction instruction = instructions . get ( i ) ; if ( predicate . test ( instruction ) ) { positions . add ( i ) ; } } return positions ; }
Searches for certain instruction positions be testing against the predicate .