// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Wrong {
    public static class ExceptionA extends Exception {
    }
    public static class ExceptionA1 extends ExceptionA {
    }
    public static class ExceptionA2 extends ExceptionA {
    }
    public static class ExceptionA3 extends ExceptionA {
    }
    public static class ExceptionB extends Exception {
    }
    public static class ExceptionB1 extends ExceptionB {
    }
    public static class ExceptionB2 extends ExceptionB {
    }
    public static class ExceptionB3 extends ExceptionB {
    }
    public static class ExceptionC extends Exception {
    }
    public static class ExceptionC1 extends ExceptionC {
    }
    public static class ExceptionC2 extends ExceptionC {
    }
    public static class ExceptionC3 extends ExceptionC {
    }
    public static class SomeLib {
        public void a() throws ExceptionA1, ExceptionA2 {
        }
        public void aa() throws ExceptionA2, ExceptionA3 {
        }
        public void b() throws ExceptionB1, ExceptionB2 {
        }
        public void bb() throws ExceptionB2, ExceptionB3 {
        }
        public void c() throws ExceptionC1, ExceptionC2 {
        }
        public void cc() throws ExceptionC2, ExceptionC3 {
        }
    }
    public static void m2() {
        SomeLib lib = new SomeLib();
        try {
            lib.a();
            lib.aa();
            lib.b();
            lib.bb();
            lib.c();
            lib.cc();
        } catch (ExceptionA1 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionA2 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionA3 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionB1 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionB2 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionB3 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionC1 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionC2 e) {
            e.printStackTrace();
            System.exit(1);
        } catch (ExceptionC3 e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
    public static void m1() {
        m2();
    }
    public static void main(String[] args) {
        m1();
    }
}
