### Question:
ArrayMap implements Map<K, V> { @Override public final Set<java.util.Map.Entry<K, V>> entrySet() { ArrayMap.Entry<K,V>[] entries = new ArrayMap.Entry[keys.length]; for ( int i=0; i<keys.length; i++ ) { entries[i] = new ArrayMap.Entry<K,V>(keys[i], values[i]); } KeySet<java.util.Map.Entry<K, V>> set = new KeySet<java.util.Map.Entry<K, V>>(entries); return set; } private  ArrayMap(final K[] keys, final V[] values); static final ArrayMap<K,V> createMap(final K[] keys, final V[] values); @Override final int size(); @Override final boolean isEmpty(); @Override final boolean containsKey(Object key); @Override final boolean containsValue(Object value); @Override final V get(Object key); @Override final V put(K key, V value); @Override final V remove(Object key); @Override final void putAll(Map<? extends K, ? extends V> m); @Override final void clear(); @Override final Set<K> keySet(); @Override final Collection<V> values(); @Override final Set<java.util.Map.Entry<K, V>> entrySet();  }### Answer:
@Test public void testEntrySet() { String[] keys = new String[]{"key1", "key2", "key3", "key4", "key5"}; String[] values = new String[]{"value1", "value2", "value3", "value4", "value5"}; Map<String, String> map = ArrayMap.createMap(keys, values); Map<String, String> hashMap = new LinkedHashMap<String, String>(); for ( int i=0; i<keys.length; i++ ) { hashMap.put(keys[i], values[i]); } Set<Entry<String, String>> set1 = map.entrySet(); Set<Entry<String, String>> set2 = hashMap.entrySet(); Iterator iterator1 = set1.iterator(); for (Iterator iterator2 = set2.iterator(); iterator2.hasNext();) { Entry<String, String> entry1 = (Entry<String, String>) iterator1.next(); Entry<String, String> entry2 = (Entry<String, String>) iterator2.next(); assertEquals(entry2.getKey(), entry1.getKey()); assertEquals(entry2.getValue(), entry1.getValue()); } }