ASTNode (@Nullable ASTNode node, @NotNull TokenSet types) { if (node == null) { return null; } for (ASTNode next = node.getTreeNext(); next != null; next = next.getTreeNext()) { if (!types.contains(next.getElementType())) { return next; } } return null; }