public static Map makeMap ( Mapper mapper , Iterator i , boolean includeNull ) { HashMap h = new HashMap ( ) ; for ( ; i . hasNext ( ) ; ) { Object k = i . next ( ) ; Object v = mapper . map ( k ) ; if ( includeNull || v != null ) { h . put ( k , v ) ; } } return h ; }
Create a new Map by using the iterator objects as keys and the mapping result as values .