### Question:
Shape { public abstract int charNeeded(); Shape(int size); abstract void print(); abstract int charNeeded();  }### Answer:
@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); }