code: public static <T> void filterListToMap(final Map<String, T> destinationMap, final String[] nameMapping,
  		final List<? extends T> sourceList) {
  		if( destinationMap == null ) {
  			throw new NullPointerException("destinationMap should not be null");
  		} else if( nameMapping == null ) {
  			throw new NullPointerException("nameMapping should not be null");
  		} else if( sourceList == null ) {
  			throw new NullPointerException("sourceList should not be null");
  		} else if( nameMapping.length != sourceList.size() ) {
  			throw new SuperCsvException(
  				String
  					.format(
  						"the nameMapping array and the sourceList should be the same size (nameMapping length = %d, sourceList size = %d)",
  						nameMapping.length, sourceList.size()));
  		}
  		
  		destinationMap.clear();
  		
  		for( int i = 0; i < nameMapping.length; i++ ) {
  			final String key = nameMapping[i];
  			
  			if( key == null ) {
  				continue; // null's in the name mapping means skip column
  			}
  			
  			// no duplicates allowed
  			if( destinationMap.containsKey(key) ) {
  				throw new SuperCsvException(String.format("duplicate nameMapping '%s' at index %d", key, i));
  			}
  			
  			destinationMap.put(key, sourceList.get(i));
  		}
  	}
docs: Converts a List to a Map using the elements of the nameMapping array as the keys of the Map.
  
  @param destinationMap
  the destination Map (which is cleared before it's populated)
  @param nameMapping
  the keys of the Map (corresponding with the elements in the sourceList). Cannot contain duplicates.
  @param sourceList
  the List to convert
  @param <T>
  the type of the values in the map
  @throws NullPointerException
  if destinationMap, nameMapping or sourceList are null
  @throws SuperCsvException
  if nameMapping and sourceList are not the same size