package com.puppycrawl.tools.checkstyle.checks.coding.missingswitchdefault;

public class InputMissingSwitchDefault {
    public void foo() {
        int i = 1;
        switch (i) {
        case 1: i++; break;
        case 2: i--; break;
        default: return;
        }
    }
}

class bad_test {
    public void foo() {
        int i = 1;
        switch (i) {
        case 1: i++; break;
        case 2: i--; break;
        }
    }

    public void nestedSwitch1() {
        int i = 1;
        switch (i) {
            case 1: i++; break;
            case 2: i--; break;
            default:
                switch (i++) { // violation
                    case 2: i++; break;
                    case 3: i--; break;
            }
        }
    }

    public void nestedSwitch2() {
        int i = 1, j = 2;
        switch(i) {
            case 1:
                switch (j) { // violation
                    case 2: break;
                    case 3: break;
            }
            default: break;
        }
    }
}

@@ -175,32 +175,36 @@
 h (i) %7B%0A        
+    
 case 1: i++; bre
@@ -207,32 +207,36 @@
  break;%0A        
+  
+  
 case 2: i--; bre
@@ -231,32 +231,36 @@
  2: i--; break;%0A
+    
         default:
@@ -359,33 +359,50 @@
     switch (i) %7B
-%0A
+ // violation%0A    
         case 1: 
@@ -405,32 +405,36 @@
  1: i++; break;%0A
+    
         case 2: 

fix indentation in test inputs and add violation comment