public static <K,V> Map.Entry<K, V> soloEntry(Map<K, V> m) {
        if ((m != null) && m.size() == 1) {
            return m.entrySet().iterator().next();
        }
        throw new IllegalArgumentException(String.format("expected a map of one entry, got %s", m));
    }