private @ Nullable String stripDefault ( List < OptionElement > options ) { String result = null ; for ( Iterator < OptionElement > i = options . iterator ( ) ; i . hasNext ( ) ; ) { OptionElement option = i . next ( ) ; if ( option . getName ( ) . equals ( "default" ) ) { i . remove ( ) ; result = String . valueOf ( option . getValue ( ) ) ; // Defaults aren't options! } } return result ; }
Defaults aren t options . This finds an option named default removes and returns it . Returns null if no default option is present .