@Test public void testToArray_sufficientSize() { Entry[] arrayToFill = new Entry[entriesList.size()]; Entry[] expectedArray = entriesList.toArray(arrayToFill); Entry[] actualArray = Maps.<String, String, Entry>toArray(entriesMap, arrayToFill); assertArrayEquals(expectedArray, actualArray); assertSame( "toArray should not have created a new array since the input array was large enough", arrayToFill, actualArray); }
public static <K, V, T> T[] toArray(Map<K, V> map, T[] entryArray) { return toList(map, entryArray.getClass().getComponentType()).toArray(entryArray); }
Maps { public static <K, V, T> T[] toArray(Map<K, V> map, T[] entryArray) { return toList(map, entryArray.getClass().getComponentType()).toArray(entryArray); } }
Maps { public static <K, V, T> T[] toArray(Map<K, V> map, T[] entryArray) { return toList(map, entryArray.getClass().getComponentType()).toArray(entryArray); } private  Maps(); }
Maps { public static <K, V, T> T[] toArray(Map<K, V> map, T[] entryArray) { return toList(map, entryArray.getClass().getComponentType()).toArray(entryArray); } 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); }
Maps { public static <K, V, T> T[] toArray(Map<K, V> map, T[] entryArray) { return toList(map, entryArray.getClass().getComponentType()).toArray(entryArray); } 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);  }