private Map getCurrentStep ( Phase phase ) { String target = phase . ordinal ( ) <= Phase . match . ordinal ( ) ? Phase . match . name ( ) : Phase . result . name ( ) ; Map lastWithValue = null ; for ( Map stepOrHook : getSteps ( ) ) { if ( stepOrHook . get ( target ) == null ) { return stepOrHook ; } else { lastWithValue = stepOrHook ; } } return lastWithValue ; }
In order to handle steps being added all at once this method determines allows methods to opperator correctly if