code: 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;
    }
docs: Generates a list 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 entryClass the entry class of type <T>
  @return a list of all map entries contained within the map parameter