Here you can find the source of reverse(Map source, Map target)
public static void reverse(Map source, Map target)
//package com.java2s; /*//from w w w .j a va2 s .c o m * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ import java.util.Iterator; import java.util.Map; public class Main { public static void reverse(Map source, Map target) { for (Iterator it = source.keySet().iterator(); it.hasNext();) { Object key = it.next(); target.put(source.get(key), key); } } }