void () { final TemplateImpl template = TemplateSettings.getInstance().getTemplate("psvm", "Java"); TestCase.assertFalse(isApplicable("class Foo {{ <caret>xxx }}", template)); TestCase.assertFalse(isApplicable("class Foo {{ <caret>xxx }}", template)); TestCase.assertFalse(isApplicable("class Foo {{ if (a <caret>xxx) }}", template)); TestCase.assertFalse(isApplicable("class Foo {{ return (<caret>xxx) }}", template)); TestCase.assertTrue(isApplicable("class Foo { <caret>xxx }", template)); TestCase.assertFalse(isApplicable("class Foo { int <caret>xxx }", template)); TestCase.assertTrue(isApplicable("class Foo {} <caret>xxx", template)); TestCase.assertTrue(isApplicable("class Foo { void foo(<caret>xxx) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { void foo(<caret>xxx String bar ) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { void foo(<caret>xxx String bar, int goo ) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { void foo(String bar, <caret>xxx int goo ) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { void foo(String bar, <caret>xxx goo ) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { <caret>xxx void foo(String bar, xxx goo ) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { void foo(<caret>String[] bar) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { <caret>xxx String[] foo(String[] bar) {} }", template)); TestCase.assertTrue(isApplicable("class Foo { /**\nfoo **/ <caret>xxx String[] foo(String[] bar) {} }", template)); TestCase.assertTrue(isApplicable("<caret>xxx package foo; class Foo {}", template)); TestCase.assertTrue(isApplicable("record R(<caret>xxx int i) {}", template)); TestCase.assertTrue(isApplicable("record R(<caret>xxx) {}", template)); TestCase.assertFalse(isApplicable("record R(int <caret>xxx)", template)); }