@Test void testCount() { ShapeFactory factory = new ShapeFactory(); Shape triangle = null; Shape square = null; try { triangle = factory.create("triangle", 3); square = factory.create("square", 5); } catch (Exception e) { fail("create failed"); } assertEquals(triangle.charNeeded(), 6); assertEquals(square.charNeeded(), 25); }
public abstract int charNeeded();
Shape { public abstract int charNeeded(); }
Shape { public abstract int charNeeded(); Shape(int size); }
Shape { public abstract int charNeeded(); Shape(int size); abstract void print(); abstract int charNeeded(); }
Shape { public abstract int charNeeded(); Shape(int size); abstract void print(); abstract int charNeeded();  }