void () { final TemplateImpl template = TemplateSettings.getInstance().getTemplate("inst", "Java"); TestCase.assertFalse(isApplicable("class Foo {{ if (a inst<caret>) }}", template)); TestCase.assertTrue(isApplicable("class Foo {{ <caret>inst }}", template)); TestCase.assertTrue(isApplicable("class Foo {{ <caret>inst\n a=b; }}", template)); TestCase.assertFalse(isApplicable("class Foo {{ return (<caret>inst) }}", template)); TestCase.assertFalse(isApplicable("class Foo {{ return a <caret>inst) }}", template)); TestCase.assertFalse(isApplicable("class Foo {{ \"<caret>\" }}", template)); TestCase.assertTrue(isApplicable("class Foo {{ <caret>a.b(); ) }}", template)); TestCase.assertTrue(isApplicable("class Foo {{ <caret>a(); ) }}", template)); TestCase.assertTrue(isApplicable("class Foo {{ Runnable r = () -> { <caret>System.out.println(\"foo\"); }; ) }}", template)); TestCase.assertTrue(isApplicable("class Foo {{ Runnable r = () -> <caret>System.out.println(\"foo\"); ) }}", template)); }