void (String addNullAnnotation) { myFixture.addFileToProject("lombok.config", """ lombok.addNullAnnotations = #PLACEHOLDER# config.stopBubbling = true """.replace("#PLACEHOLDER#", addNullAnnotation)); myFixture.addClass(""" import lombok.Data; import lombok.Builder; import lombok.experimental.SuperBuilder; public class App { @Data @Builder public static class MyObjectB { private String myString; private String nonNullString; } @Data @SuperBuilder public static class MyObjectS { private String myString; private String nonNullString; } public static void main(final String[] args) { final MyObjectB myObjectB = MyObjectB.builder() .nonNullString("someString builder") .myString("myString builder") .build(); System.out.println(myObjectB); final MyObjectS myObjectS = MyObjectS.builder() .nonNullString("someString super builder") .myString("myString super builder") .build(); System.out.println(myObjectS); } }"""); final PsiClass myObjectBClass = myFixture.findClass("App.MyObjectB"); final PsiClass myObjectBBuilderClass = myFixture.findClass("App.MyObjectB.MyObjectBBuilder"); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectBClass, "builder"))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectBClass, "toString"))); assertEquals(NULLABLE, DfaPsiUtil.getElementNullability(null, findMethodParam(myObjectBClass, "equals", 0))); assertEquals(NULLABLE, DfaPsiUtil.getElementNullability(null, findMethodParam(myObjectBClass, "canEqual", 0))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectBBuilderClass, "nonNullString"))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectBBuilderClass, "myString"))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectBBuilderClass, "build"))); final PsiClass myObjectSClass = myFixture.findClass("App.MyObjectS"); final PsiClass myObjectSBuilderClass = myFixture.findClass("App.MyObjectS.MyObjectSBuilder"); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectSClass, "builder"))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectSClass, "toString"))); assertEquals(NULLABLE, DfaPsiUtil.getElementNullability(null, findMethodParam(myObjectSClass, "equals", 0))); assertEquals(NULLABLE, DfaPsiUtil.getElementNullability(null, findMethodParam(myObjectSClass, "canEqual", 0))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectSBuilderClass, "nonNullString"))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectSBuilderClass, "myString"))); assertEquals(NOT_NULL, DfaPsiUtil.getElementNullability(null, findMethod(myObjectSBuilderClass, "build"))); }