### Question:
CaseManagementSvgStageShapeDef extends BaseDimensionedShapeDef implements CaseManagementSvgShapeDef<AdHocSubprocess> { @Override public SVGShapeView<?> newViewInstance(final CaseManagementSVGViewFactory factory, final AdHocSubprocess bean) { return newViewInstance(Optional.empty(), Optional.empty(), factory.stage()); }  @Override SizeHandler<AdHocSubprocess, SVGShapeView> newSizeHandler(); @Override SVGShapeView<?> newViewInstance(final CaseManagementSVGViewFactory factory, final AdHocSubprocess bean); @Override Glyph getGlyph(final Class<? extends AdHocSubprocess> type,
                          final String defId);  }### Answer:
@Test public void testNewViewInstance() throws Exception { tested.newViewInstance(factory, new AdHocSubprocess()); verify(factory, times(1)).stage(); }
@Test public void testNewViewInstance_zeroDimension() throws Exception { final Width width = new Width(0.0); final Height height = new Height(0.0); final RectangleDimensionsSet dimensionsSet = new RectangleDimensionsSet(); dimensionsSet.setWidth(width); dimensionsSet.setHeight(height); final AdHocSubprocess adHocSubprocess = new AdHocSubprocess(); adHocSubprocess.setDimensionsSet(dimensionsSet); tested.newViewInstance(factory, new AdHocSubprocess()); verify(factory, times(1)).stage(); }