boolean (@NotNull UElement sourceNode, @NotNull UClass sourceClass, boolean forClassReference) { UElement parent = sourceClass.getUastParent(); if (parent instanceof UObjectLiteralExpression) { if (ContainerUtil.exists(((UCallExpression)parent).getValueArguments(), it -> UastUtils.isPsiAncestor(it, sourceNode))) { return true; } } return forClassReference && ContainerUtil.exists(sourceClass.getUastSuperTypes(), it -> UastUtils.isPsiAncestor(it, sourceNode)); }