code: @SuppressWarnings("unchecked")
      static <K,V> Map<K,V> asMap(Object value, PDescriptor keyType, PDescriptor itemType) throws ProvidenceConfigException {
          if (value instanceof Map) {
              boolean sorted = value instanceof TreeMap ||
                               value instanceof ImmutableSortedMap;
              Map<K,V> out = sorted ? new TreeMap<>() : new LinkedHashMap<>();
              for (Map.Entry item : ((Map<?,?>) value).entrySet()) {
                  out.put((K) asType(keyType, item.getKey()),
                          (V) asType(itemType, item.getValue()));
              }
              return out;
          }
          throw new ProvidenceConfigException(
                  "Unable to convert " + value.getClass().getSimpleName() + " to a collection");
      }
docs: Convert the value to a collection.
  
  @param value The value instance.
  @param keyType The key type descriptor.
  @param itemType The value type descriptor.
  @param <K> The map key type.
  @param <V> The map value type.
  @return The map value.
  @throws ProvidenceConfigException When unable to convert value.