package dk.itu.oop.lecture6; public class TestClass { public class CheckFailure extends RuntimeException { public String msg; CheckFailure(String msg){ this.msg = msg; } } protected void check(boolean expr) throws CheckFailure{ if (!expr) throw new CheckFailure("Check failed"); } protected void check(String msg, boolean expr) throws CheckFailure{ if (!expr) throw new CheckFailure(msg); } }