void () { doTest( """ import org.jetbrains.annotations.Contract; class Test { boolean closed; \s @Contract(pure=true, value="->this") Test validate() { if(closed) throw new IllegalStateException(); return this; } \s void test() { validate(); System.out.println("ok"); } } """); }