Java tutorial
//package com.java2s; import java.util.Map; public class Main { private static <K, V> Map<K, V> composeMapImpl(Iterable<Map.Entry<K, V>> entrySet, Map<K, V> target) { target.clear(); for (Map.Entry<K, V> entry : entrySet) { target.put(entry.getKey(), entry.getValue()); } return target; } }