public static <K,V> HashMap<V,K> reverse(Map<K,V> map) { return map.entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));;}