### Question:
Collections { public static <K, V> Map<K, V> map(Object... keysAndValues) { if (keysAndValues.length % 2 != 0) { throw new IllegalArgumentException("number of arguments must be even"); } Map<K, V> map = new HashMap<K, V>(Math.max(keysAndValues.length, 16)); for (int i = 0; i < keysAndValues.length;) { map.put((K) keysAndValues[i++], (V) keysAndValues[i++]); } return map; } private  Collections(); static T[] arr(T... values); static T[] array(T... values); static Set<T> set(T... values); static Map<K, V> map(Object... keysAndValues); static List<T> li(T... values); static List<T> list(T... values);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void shouldRejectOddNumberOfArguments(){ Collections.map("hi"); }
@Test public void shouldCreateProperMap(){ Map<String, Object> person = Collections.map("name", "James", "last_name", "Belushi"); a(person.get("name")).shouldBeEqual("James"); a(person.get("last_name")).shouldBeEqual("Belushi"); }