public static void runGame() { try { engine.run(); } catch (InvalidMoveException e) { ExceptionHandler.handle(e); } }
@Test public void testAbstractFactory() { CarFactory carFactory = new LuxuryCarFactory(); Engine engine = carFactory.createEngine(); engine.run(); engine.start(); }
public static void main(String[] args) { CarFactory factory = new LuxuryCarFactory(); Engine e = factory.createEngine(); e.run(); e.start(); }