boolean (@Nullable ASTNode node) { if (node == null || node.getElementType() != JavaElementType.NEW_EXPRESSION) { return false; } ASTNode lastChild = node.getLastChildNode(); return lastChild != null && lastChild.getElementType() == JavaElementType.ANONYMOUS_CLASS; }