package Examples; public class SimpleConditionals { public void methodWithIfNoElse(int x) { if (x > 10) x--; } public int methodWithNestedIf(int x) { if (x > 0) if (x > 10) x = 0; else x = 1; else x = 3; return x; } public int methodWithSwitch(int x) { x++; switch (x) { case 0: x++; case 1: x = 0; case 2: x--; default: x = 2; } return x; } public int methodWithSwitchAndBreak(int x) { x++; switch (x) { case 0: x++; break; case 1: x = 0; case 2: x--; default: x = 2; } return x; } public void methodWithNegatedGuard(int x) { int i = 8; if(9==i) // 2 unfeasible paths because of this x--; if (!(x + 1 == 19)) x++; } public void methodWithCompositeGuard(int x) { if (x > 0 && x < 10) x++; } }