### Question:
Maps { public static <T> T getListValue(final Map<String, List<T>> values, final String name, final int index) { List<T> list = values.get(name); if ((list != null) && !list.isEmpty()) { T item = list.get(index); return item; } return null; }  @SuppressWarnings("unchecked") static void addListValue(final Map<K, List<T>> map, final K key, final T value); static void addArrayValue(final Map<T, String[]> map, final T key, final String value); static T getListValue(final Map<String, List<T>> values, final String name, final int index); static Map<String, String[]> toArrayMap(final Map<String, List<String>> parameterMap);  }### Answer:
@Test public void testGetListValueEmpty() throws Exception { Map<String, List<String>> map = new TreeMap<String, List<String>>(); Assert.assertEquals(null, Maps.getListValue(map, "lincoln", 0)); }
@Test public void testGetListValue() throws Exception { Map<String, List<String>> map = new TreeMap<String, List<String>>(); Maps.addListValue(map, "lincoln", "baxter"); Maps.addListValue(map, "lincoln", "III"); Assert.assertEquals("baxter", Maps.getListValue(map, "lincoln", 0)); Assert.assertEquals("III", Maps.getListValue(map, "lincoln", 1)); }