[source,apex,diff-id=1,diff-type=noncompliant]
----
if (a >= 0 && a < 10) {
  doFirstThing();
  doTheThing();
}
else if (a >= 10 && a < 20) {
  doTheOtherThing();
}
else if (a >= 20 && a < 50) {
  doFirstThing();
  doTheThing();  // Noncompliant; duplicates first condition
}
else {
  doTheRest(); 
}
----

[source,apex,diff-id=2,diff-type=noncompliant]
----
switch on i {
  when 1 {
    doFirstThing();
    doSomething();
  }
  when 2 {
    doSomethingDifferent();
  }
  when 3 {  // Noncompliant; duplicates when 1's implementation
    doFirstThing();
    doSomething(); 
  }
  when else {
    doTheRest();
  }
}
----