boolean (@Nullable ASTNode node, IElementType expectedSiblingType, IElementType... skipTypes) { for (ASTNode prevNode = node == null ? null : node.getTreePrev(); prevNode != null; prevNode = prevNode.getTreePrev()) { if (isWhitespaceOrEmpty(prevNode) || isOneOf(prevNode, skipTypes)) continue; if (prevNode.getElementType() == expectedSiblingType) return true; } return false; }