void () { // Inspired by IDEA-52127 getSettings().SPACE_AROUND_UNARY_OPERATOR = false; String initial = """ public class FormattingTest { public void foo() { int i = 1; System.out.println(-i); System.out.println(+i); System.out.println(++i); System.out.println(i++); System.out.println(--i); System.out.println(i--); boolean b = true; System.out.println(!b); } }"""; doTextTest(initial, initial); // Don't expect spaces to be inserted after unary operators getSettings().SPACE_AROUND_UNARY_OPERATOR = true; String formatted = """ public class FormattingTest { public void foo() { int i = 1; System.out.println(- i); System.out.println(+ i); System.out.println(++ i); System.out.println(i++); System.out.println(-- i); System.out.println(i--); boolean b = true; System.out.println(! b); } }"""; doTextTest(initial, formatted); // Expect spaces to be inserted after unary operators }