private void addPair(final long n1, final long n2) {
        if (map == null) {
            map = new CompactLongMap<>();
        }
        npairs++;

        OsmNodePair e = getElement(n1, n2);
        if (e == null) {
            e = new OsmNodePair();
            e.node2 = n2;

            OsmNodePair e0 = map.get(n1);
            if (e0 != null) {
                while (e0.next != null) {
                    e0 = e0.next;
                }
                e0.next = e;
            } else {
                map.fastPut(n1, e);
            }
        }
    }
Set holding pairs of osm nodes

@author ab
main/src/main/java/cgeo/geocaching/brouter/mapaccess/OsmNodePairSet.java