void (Instruction instruction) { if (afterStates.size() <= 1 && killedStates.isEmpty()) return; Map<Instruction, List<TrackingDfaMemoryState>> instructionToState = StreamEx.of(afterStates).mapToEntry(s -> s.getInstruction(), s -> (TrackingDfaMemoryState)s.getMemoryState()).grouping(); if (instructionToState.size() <= 1 && killedStates.isEmpty()) return; instructionToState.forEach((target, memStates) -> { List<TrackingDfaMemoryState> bridgeChanges = StreamEx.of(afterStates).filter(s -> s.getInstruction() != target) .map(s -> ((TrackingDfaMemoryState)s.getMemoryState())) .append(killedStates) .toList(); for (TrackingDfaMemoryState state : memStates) { state.addBridge(instruction, bridgeChanges); } }); }