code: public static <K, V, T> T[] toArray(Map<K, V> map, T[] entryArray) {
      return toList(map, entryArray.getClass().getComponentType()).toArray(entryArray);
    }
docs: Generates an array of entries from a map. Entries are defined in the API as
  a class which consists of a {@code key} and {@code value} with a name
  typically in the form of {@code Key_ValueMapEntry}, represented here as
  {@code T}. The generated array can be used in objects where {@code
  List<Key_ValueMapEntry>} is taken as a value. The input map must have same type
  {@code K} as the {@code key} within {@code Key_ValueMapEntry}. The same
  applies for {@code V} and {@code value} within {@code Key_ValueMapEntry}.
  
  @param <K> the type of the entry key
  @param <V> the type of the entry value
  @param <T> the map entry type
  @param map a map of type {@code K} and {@code V} representing the entry
  array
  @param entryArray the entry array that entries will be added into
  @return an array all map entries contained within the map parameter into
  the provided array or a new array if there was not enough room