static Map> lcStream_rightPartnerMap(LCStreamingCompressor comp) { MultiSet ms = lcStream_itemCounts(comp); new Map> partners; for (int i = 0; i < comp.nItems(); i++) { IntPair p = comp.getPair(i); if (p != null) { int n = ms.get(i); //print("pair " + p + " => " + n); getOrCreate(() -> new OptimizedMultiSet, partners, p.a).add(p.b, n); } } for (IntPair p : overlappingIntPairs(comp.chain.toList())) getOrCreate(() -> new OptimizedMultiSet, partners, p.a).add(p.b); ret partners; }