### Question:
ArrayMap implements Map<K, V> { public static final <K,V> ArrayMap<K,V> createMap(final K[] keys, final V[] values) { if ( keys == null || values == null || keys.length != values.length || keys.length == 0) { throw new IllegalArgumentException("ArrayMap's keys and values are illegal. keys:"+keys+", values: " + values + ", keys.length:"+keys.length+", values.length:"+values.length); } ArrayMap<K,V> arrayMap = new ArrayMap<K,V>(keys, values); return arrayMap; } 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 testCreateMap2() { String[] keys = new String[]{"key1"}; String[] values = new String[]{"value1", "value2"}; Map<String, String> map; try { map = ArrayMap.createMap(keys, values); fail("should throw exception"); } catch (Exception e) { } }
@Test public void testCreateMap3() { String[] keys = new String[0]; String[] values = new String[]{"value1", "value2"}; Map<String, String> map; try { map = ArrayMap.createMap(keys, values); fail("should throw exception"); } catch (Exception e) { } }
@Test public void testCreateMap4() { String[] keys = null; String[] values = new String[]{"value1", "value2"}; Map<String, String> map; try { map = ArrayMap.createMap(keys, values); fail("should throw exception"); } catch (Exception e) { } }
@Test public void testCreateMap5() { String[] keys = new String[]{"key1"}; String[] values = null; Map<String, String> map; try { map = ArrayMap.createMap(keys, values); fail("should throw exception"); } catch (Exception e) { } }