question: protected Set < FunctionInterface > findUnusedFunctions ( Set < UnitInterface > units ) { Set < FunctionInterface > allFunctions = new HashSet < FunctionInterface > ( ) ; Set < FunctionInterface > usedFunctions = new HashSet < FunctionInterface > ( ) ; for ( UnitInterface unit : units ) { List < FunctionInterface > unitFunctions = getUnitFunctions ( unit ) ; allFunctions . addAll ( unitFunctions ) ; for ( FunctionInterface unitFunction : unitFunctions ) { for ( FunctionInterface usedFunction : unitFunction . getCalledFunctions ( ) ) { usedFunctions . add ( usedFunction ) ; } } } allFunctions . removeAll ( usedFunctions ) ; return allFunctions ; }
target:  Find unused functions in a unit