### Question:
Maps { public static <K, V, T> List<T> toList(Map<K, V> map, Class<T> entryClass) { Preconditions.checkNotNull(entryClass, "Entry class cannot be null."); List<T> result = Lists.newArrayList(); for (Entry<K, V> entry : map.entrySet()) { try { T newEntry = entryClass.newInstance(); PropertyUtils.setProperty(newEntry, "key", entry.getKey()); PropertyUtils.setProperty(newEntry, "value", entry.getValue()); result.add(newEntry); } catch (InvocationTargetException e) { throw new IllegalStateException("Unexpected exception while creating map entries: " + e.getMessage(), e.getTargetException()); } catch (IllegalAccessException e) { throw new IllegalStateException("Unexpected exception while creating map entries: " + e.getMessage(), e); } catch (InstantiationException e) { throw new IllegalStateException("Unexpected exception while creating map entries: " + e.getMessage(), e); } catch (NoSuchMethodException e) { throw new IllegalStateException("Unexpected exception while creating map entries: " + e.getMessage(), e); } } return result; } private  Maps(); @SuppressWarnings("unchecked") static Map<K, V> toMap(List<T> entryList); static Map<K, V> toMap(T[] entryArray); static T[] toArray(Map<K, V> map, T[] entryArray); static List<T> toList(Map<K, V> map, Class<T> entryClass);  }### Answer:
@Test public void testToList() { List<Entry> actualList = Maps.toList(entriesMap, Entry.class); assertEquals(entriesList, actualList); }