public static Module combineAndOverride ( List < ? extends Module > modules ) { Iterator < ? extends Module > iter = modules . iterator ( ) ; Module current = Modules . EMPTY_MODULE ; if ( iter . hasNext ( ) ) { current = iter . next ( ) ; if ( iter . hasNext ( ) ) { current = Modules . override ( current ) . with ( iter . next ( ) ) ; } } return current ; }
Generate a single module that is produced by accumulating and overriding each module with the next .