SvgDrawContext { public void addNamedObjects(Map<String, ISvgNodeRenderer> namedObjects) { this.namedObjects.putAll(namedObjects); } SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider);  SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider, ISvgNodeRenderer svgRootRenderer); PdfCanvas getCurrentCanvas(); PdfCanvas popCanvas(); void pushCanvas(PdfCanvas canvas); int size(); void addViewPort(Rectangle viewPort); Rectangle getCurrentViewPort(); Rectangle getRootViewPort(); void removeCurrentViewPort(); void addNamedObject(String name, ISvgNodeRenderer namedObject); ISvgNodeRenderer getNamedObject(String name); ResourceResolver getResourceResolver(); void addNamedObjects(Map<String, ISvgNodeRenderer> namedObjects); FontProvider getFontProvider(); FontSet getTempFonts(); void setTempFonts(FontSet tempFonts); boolean isIdUsedByUseTagBefore(String elementId); void addUsedId(String elementId); void removeUsedId(String elementId); AffineTransform getLastTextTransform(); void setLastTextTransform(AffineTransform newTransform); float[] getTextMove(); void resetTextMove(); void addTextMove(float additionalMoveX, float additionalMoveY); AffineTransform getCurrentCanvasTransform(); float getRemValue();  }
@Test public void addNamedObjects(){ ISvgNodeRenderer expectedOne = new DummySvgNodeRenderer(); ISvgNodeRenderer expectedTwo = new DummySvgNodeRenderer(); ISvgNodeRenderer expectedThree = new DummySvgNodeRenderer(); String dummyNameOne = "Ed"; String dummyNameTwo="Edd"; String dummyNameThree="Eddy"; Map<String,ISvgNodeRenderer> toAdd = new HashMap<>(); toAdd.put(dummyNameOne,expectedOne); toAdd.put(dummyNameTwo,expectedTwo); toAdd.put(dummyNameThree,expectedThree); this.context.addNamedObjects(toAdd); Object actualThree = this.context.getNamedObject(dummyNameThree); Object actualTwo = this.context.getNamedObject(dummyNameTwo); Object actualOne = this.context.getNamedObject(dummyNameOne); Assert.assertEquals(expectedOne, actualOne); Assert.assertEquals(expectedTwo, actualTwo); Assert.assertEquals(expectedThree, actualThree); }