void () { boolean foo = false; boolean bar = true; // test removing this if if(!foo) { bar = true; } else { bar = false; } // test removing this if if(!foo) { bar = false; } else { bar = true; } // test that this if can't be removed if(foo) { bar = true; } else { bar = true; } // test that this if can't be removed if(!foo) { bar = false; } else { bar = false; } }