/** End is where the previous node is a chunk start * or this is a {@link BlockEndNode} whose {@link BlockStartNode} has a label action */ @Override public boolean isChunkEnd(@Nonnull FlowNode current, @CheckForNull FlowNode previous) { if (previous == null) { return false; } if (current instanceof BlockEndNode) { BlockStartNode bsn = ((BlockEndNode) current).getStartNode(); if (isChunkStart(bsn, null)) { return true; } } return isChunkStart(previous, null); } }