void () { final TemplateImpl template = TemplateSettings.getInstance().getTemplate("toar", "Java"); assert !isApplicable("class Foo {{ if (a <caret>toar) }}", template); assert isApplicable("class Foo {{ <caret>toar }}", template); assert isApplicable("class Foo {{ return (<caret>toar) }}", template); assert !isApplicable("class Foo {{ return (aaa <caret>toar) }}", template); assert isApplicable("class Foo {{ Runnable r = () -> { <caret>System.out.println(\"foo\"); }; ) }}", template); assert isApplicable("class Foo {{ Runnable r = () -> <caret>System.out.println(\"foo\"); ) }}", template); assert !isApplicable("class Foo extends <caret>t {}", template); assert !isApplicable("record R(int i, <caret>toar) {}", template); }