Int2ObjectMap<LeafBlockWrapper> (final LeafBlockWrapper first) { final Int2ObjectMap<LeafBlockWrapper> result = new Int2ObjectOpenHashMap<>(); LeafBlockWrapper current = first; while (current != null) { result.put(current.getStartOffset(), current); current = current.getNextBlock(); } return result; }