How is this better than making a special subclass of RevWalk that overrides createCommit() to provide its own subclass of RevCommit that carries BitSet member? That would use less memory, and make the whole thing slightly less awkward for the caller to work with as they don't have to try to register the CommonCommitLimitedRevQueue against an existing RevWalk they created. But it does mean you cannot convert an existing graph held by an existing RevWalk to perform this operation, the application author would need to decide which type of RevWalk to create and what type of graph they want to maintain in memory.