void (SortedSet<? extends ChainOpAndOccurrences> operations, List<? super OperationChain> chains) { int bestOccurrences = -1; for (ChainOpAndOccurrences indexValue : operations) { OperationChain operationChain = OperationChain.create(indexValue.getOperation(), indexValue.getOccurrenceCount(), myContext); if (operationChain != null) { chains.add(operationChain); int occurrences = indexValue.getOccurrenceCount(); if (bestOccurrences == -1) { bestOccurrences = occurrences; } else if (bestOccurrences > occurrences * ChainSearchMagicConstants.FILTER_RATIO) { return; } } } }