code: public static <K,V> List<Pair<K,V>> mapToPair(Map<K,V> map) {
          List<Pair<K,V>> ret = new ArrayList<>(map.size());
          for(Map.Entry<K,V> entry : map.entrySet()) {
              ret.add(Pair.of(entry.getKey(),entry.getValue()));
          }
  
          return ret;
      }
docs: Convert a map with a set of entries of type K for key
  and V for value in to a list of {@link Pair}
  @param map the map to collapse
  @param <K> the key type
  @param <V> the value type
  @return the collapsed map as a {@link List}