code: public static Map<?, ?> convertToMap(Collection<?> coll, String keyProperty, String valueProperty) {
      Map<Object, Object> map = newHashMap();
      for (Object obj : coll) {
        Object key = PropertyUtils.getProperty(obj, keyProperty);
        Object value = PropertyUtils.getProperty(obj, valueProperty);
        if (null != key) map.put(key, value);
      }
      return map;
    }
docs: <p>
  convertToMap.
  </p>
  
  @param coll a {@link java.util.Collection} object.
  @param keyProperty a {@link java.lang.String} object.
  @param valueProperty a {@link java.lang.String} object.
  @return a {@link java.util.Map} object.