Cache { public void addIFDProtocol(AddonSpecification spec, String uri, IFDProtocol protocol) { addEntry(spec, uri, protocol); } Cache(); void addSALProtocol(AddonSpecification spec, String uri, SALProtocol protocol); void addIFDProtocol(AddonSpecification spec, String uri, IFDProtocol protocol); void addAppExtensionAction(AddonSpecification spec, String actionId, AppExtensionAction action); void addAppPluginAction(AddonSpecification spec, String resourceId, AppPluginAction action); IFDProtocol getIFDProtocol(AddonSpecification spec, String uri); SALProtocol getSALProtocol(AddonSpecification spec, String uri); AppExtensionAction getAppExtensionAction(AddonSpecification spec, String actionId); AppPluginAction getAppPluginAction(AddonSpecification spec, String resourceName); void removeCacheEntry(AddonSpecification spec, String id); void removeCompleteAddonCache(AddonSpecification spec);  }
@Test public void addIFDProtocol() { IFDProtocolProxy proxy = new IFDProtocolProxy(null, null); int initialHash = proxy.hashCode(); AddonSpecification spec = new AddonSpecification(); String id = "test"; spec.setId(id); spec.setVersion("1.0.0"); cache.addIFDProtocol(spec, id, proxy); IFDProtocol proto = cache.getIFDProtocol(spec, id); Assert.assertEquals(proto.hashCode(), initialHash); }