code: @SuppressWarnings("unchecked")
    public static <K, V, T> Map<K, V> toMap(List<T> entryList) throws IllegalArgumentException {
      Preconditions.checkNotNull(entryList, "Entry list cannot be null.");
  
      Map<K, V> result = com.google.common.collect.Maps.newHashMap();
      for (Object entry : entryList) {
        try {
          Object key = PropertyUtils.getProperty(entry, "key");
          Object value = PropertyUtils.getProperty(entry, "value");
  
          result.put((K) key, (V) value);
        } catch (InvocationTargetException e) {
          throw new IllegalStateException("Unexpected exception while creating map: "
              + e.getMessage(), e.getTargetException());
        } catch (IllegalAccessException e) {
          throw new IllegalStateException("Unexpected exception while creating map: "
              + e.getMessage(), e);
        } catch (NoSuchMethodException e) {
          throw new IllegalStateException("Unexpected exception while creating map: "
              + e.getMessage(), e);
        }
      }
      return result;
    }
docs: Generates a map from a list of entries. 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 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 entryList the list of entries constituting a map as represented in
  the API
  @return a map of type {@code K} and {@code V} representing the entry array
  @throws IllegalArgumentException if {@code entryArray} is not compatible
  with {@code Map<K, V>} or if {@code entryArray == null}