code: public static <K, V> Map<K, V> wrap(Dictionary<K, V> dictionary) {
          if (dictionary instanceof MapAsDictionary) {
              return ((MapAsDictionary<K, V>) dictionary).getMap();
          }
          return new DictionaryAsMap<K, V>(dictionary);
      }
docs: creates a Map-representation of the dictionary. If the dictionary is an instance of {@link MapAsDictionary} the
  original map is returned to prevent deeper nesting.