public class And3 { static CompositeGate makeAnd3() { Gate comp = new CompositeGate(); Gate a1 = new AndGate("and1"); Gate a2 = new AndGate("and2"); Connector.connect(a1.outWire(0), a2.inWire(0)); comp.addGate(a1); comp.addGate(a2); comp.addIn(a1.inWire(0)); comp.addIn(a1.inWire(1)); comp.addIn(a2.inWire(1)); comp.addOut(a2.outWire(0)); return comp; } public static void main(String args[]) { Gate g = makeAnd3(); GateTester.test(g); } }