public class LockConnector extends CountConnector { //inner class to glom on the componenet. public class LockBase extends LockAPPC.LockComponent { public Inner inner; public Inner inner1 = new Inner1(); public Inner inner2 = new Inner2(); public Inner inner3 = new Inner3(); public Inner inner4 = new Inner4(); public Object get_host() { return LockConnector.this; } public void actualOp(Object passed) { inner.actualOp(passed); } public void actualOp(Object passed, Object passed2) { inner.actualOp(passed, passed2); } public Object actualOp() { return inner.actualOp(); } interface Inner { public void actualOp(Object passed); public void actualOp(Object passed, Object passed2); public Object actualOp(); } public class Inner1 implements Inner { public void actualOp(Object passed) { LockConnector.this.expected_pushOn(passed); } public void actualOp(Object passed, Object passed2){} public Object actualOp() { return null; } } public class Inner2 implements Inner { public void actualOp(Object passed) { LockConnector.this.expected_pushTwice(passed); } public void actualOp(Object passed, Object passed2){} public Object actualOp() { return null; } } public class Inner3 implements Inner { public void actualOp(Object passed){} public void actualOp(Object passed, Object passed2){} public Object actualOp() { return LockConnector.this.expected_popOff(); } } public class Inner4 implements Inner { public void actualOp(Object passed){} public void actualOp(Object passed, Object passed2) { LockConnector.this.expected_pushTwo(passed, passed2); } public Object actualOp() { return null; } } public LockBase setInner(Inner inner) { this.inner = inner; return this; } } public LockBase c = new LockBase(); public void expected_pushOn(Object passed) { super.pushOn2(passed); } public void expected_pushTwice(Object passed) { super.pushTwice2(passed); } public void expected_pushTwo(Object passed, Object passed2) { super.pushTwo2(passed, passed2); } public Object expected_popOff() { return super.popOff2(); } // overridden new methods public void pushOn(Object passed) { c.setInner(c.inner1).pushOp(passed); } public void pushTwice(Object passed) { c.setInner(c.inner2).pushOp(passed); } public void pushTwo(Object passed, Object passed2) { c.setInner(c.inner4).pushOp(passed, passed2); } public Object popOff() { return c.setInner(c.inner3).popOp(); } }