public static <K,V>Map<K,V> createMap(List<K> keys,List<V> values){
  if (keys == null || values == null || keys.size() != values.size()) {
    throw new IllegalArgumentException("Keys and Values cannot be null and must be the same size");
  }
  Map<K,V> newMap=new HashMap<K,V>();
  for (int i=0; i < keys.size(); i++) {
    newMap.put(keys.get(i),values.get(i));
  }
  return newMap;
}

public static < K , V > Map < K , V > createMap ( List < K > keys , List < V > values ) { if ( keys == null || values == null || keys . size ( ) != values . size ( ) ) { throw new IllegalArgumentException ( "Keys and Values cannot be null and must be the same size" ) ; } Map < K , V > newMap = new HashMap < K , V > ( ) ; for ( int i = 0 ; i < keys . size ( ) ; i ++ ) { newMap . put ( keys . get ( i ) , values . get ( i ) ) ; } return newMap ; }
create a map from a list of keys and a list of values
