void () { boolean foo = true; boolean bar = true; //test merge these if(foo) { if(bar) { System.out.println("test2"); } } //test merge these if(foo) if(bar) System.out.println("test2"); //test merge these if(foo) { if(bar) System.out.println("test2"); } //test merge these if(foo) if(bar) { System.out.println("test2"); } //test that these don't merge if(foo) { if(bar) { System.out.println("test2"); } else { System.out.println("test3"); } } //test that these don't merge if(foo) { if(bar) { System.out.println("test2"); } } else { System.out.println("test3"); } }