Source:
<code>private void enqueueExceptionalPaths(ProgramState ps, @Nullable MethodYield methodYield) { Set<CFG.Block> exceptionBlocks = node.programPoint.block.exceptions(); List<CFG.Block> catchBlocks = exceptionBlocks.stream().filter(CFG.Block.IS_CATCH_BLOCK).collect(Collectors.toList()); SymbolicValue peekValue = ps.peekValue(); Preconditions.checkState(peekValue instanceof SymbolicValue.ExceptionalSymbolicValue, "Top of stack should always contains exceptional SV"); SymbolicValue.ExceptionalSymbolicValue exceptionSV = (SymbolicValue.ExceptionalSymbolicValue) peekValue; Type thrownType = exceptionSV.exceptionType(); Optional<CFG.Block> firstMatchingCatchBlock = catchBlocks.stream() .filter(b -> isCaughtByBlock(thrownType, b)) .sorted((b1, b2) -> Integer.compare(b2.id(), b1.id())) .findFirst(); if (firstMatchingCatchBlock.isPresent()) { enqueue(new ProgramPoint(firstMatchingCatchBlock.get()), ps, methodYield); return; } if (thrownType == null || thrownType.isUnknown()) { catchBlocks.stream() .filter(ExplodedGraphWalker::isCatchingUncheckedException) .forEach(b -> enqueue(new ProgramPoint(b), ps, methodYield)); } ps.storeExitValue(); List<CFG.Block> otherBlocks = exceptionBlocks.stream() .filter(CFG.Block.IS_CATCH_BLOCK.negate()).collect(Collectors.toList()); <START> if (!otherBlocks.isEmpty()) { <END> otherBlocks.forEach(b -> enqueue(new ProgramPoint(b), ps, true, methodYield)); } else { CFG.Block methodExit = node.programPoint.block.successors() .stream() .filter(CFG.Block::isMethodExitBlock) .findFirst() .orElse(exitBlock); enqueue(new ProgramPoint(methodExit), ps, true, methodYield); } }</code><technical_language>condition inversed in fact for applied matter what, if empty, this is a noop. Thus, need collect</technical_language>

Target:
private void enqueueExceptionalPaths(ProgramState ps, @Nullable MethodYield methodYield) { Set<CFG.Block> exceptionBlocks = node.programPoint.block.exceptions(); List<CFG.Block> catchBlocks = exceptionBlocks.stream().filter(CFG.Block.IS_CATCH_BLOCK).collect(Collectors.toList()); SymbolicValue peekValue = ps.peekValue(); Preconditions.checkState(peekValue instanceof SymbolicValue.ExceptionalSymbolicValue, "Top of stack should always contains exceptional SV"); SymbolicValue.ExceptionalSymbolicValue exceptionSV = (SymbolicValue.ExceptionalSymbolicValue) peekValue; Optional<CFG.Block> firstMatchingCatchBlock = catchBlocks.stream() .filter(b -> isCaughtByBlock(exceptionSV.exceptionType(), b)) .sorted((b1, b2) -> Integer.compare(b2.id(), b1.id())) .findFirst(); if (firstMatchingCatchBlock.isPresent()) { enqueue(new ProgramPoint(firstMatchingCatchBlock.get()), ps, methodYield); return; } catchBlocks.stream() .filter(ExplodedGraphWalker::isCatchingUncheckedException) .forEach(b -> enqueue(new ProgramPoint(b), ps, methodYield)); ps.storeExitValue(); List<CFG.Block> otherBlocks = exceptionBlocks.stream() .filter(CFG.Block.IS_CATCH_BLOCK.negate()) .collect(Collectors.toList()); if (otherBlocks.isEmpty()) { CFG.Block methodExit = node.programPoint.block.successors() .stream() .filter(CFG.Block::isMethodExitBlock) .findFirst() .orElse(exitBlock); enqueue(new ProgramPoint(methodExit), ps, true, methodYield); } else { otherBlocks.forEach(b -> enqueue(new ProgramPoint(b), ps, true, methodYield)); } }