### Question:
XWikiWikiModel implements WikiModel { @Override public String getImageURL(ResourceReference imageReference, Map<String, String> parameters) { if (imageReference.getType().equals(ResourceType.ICON)) { return this.skinAccessBridge.getIconURL(imageReference.getReference()); } if (this.extendedRenderingConfiguration.isImageDimensionsIncludedInImageURL()) { Map<String, Object> urlParameters = getImageURLParameters(parameters); if (!urlParameters.isEmpty()) { String queryString = imageReference.getParameter(AttachmentResourceReference.QUERY_STRING); queryString = extendQueryString(queryString, urlParameters); ResourceReference scaledImageReference = imageReference.clone(); scaledImageReference.setParameter(AttachmentResourceReference.QUERY_STRING, queryString); return getLinkURL(scaledImageReference); } } return getLinkURL(imageReference); }  @Override String getLinkURL(ResourceReference linkReference); @Override String getImageURL(ResourceReference imageReference, Map<String, String> parameters); @Override boolean isDocumentAvailable(ResourceReference resourceReference); @Override String getDocumentViewURL(ResourceReference resourceReference); @Override String getDocumentEditURL(ResourceReference resourceReference); @Override XDOM getXDOM(ResourceReference resourceReference);  }### Answer:
@Test void getImageURLWhenIcon() { ResourceReference reference = new ResourceReference("iconname", ResourceType.ICON); when(skinAccessBridge.getIconURL("iconname")).thenReturn("/path/to/icon"); assertEquals("/path/to/icon", this.wikiModel.getImageURL(reference, Collections.emptyMap())); }