RemoteServiceAdminCore implements RemoteServiceAdmin { protected Map<String, Object> createEndpointProps(Map<String, Object> effectiveProps, Class<?>[] ifaces) { Map<String, Object> props = new HashMap<>(); copyEndpointProperties(effectiveProps, props); props.remove(org.osgi.framework.Constants.SERVICE_ID); EndpointHelper.addObjectClass(props, ifaces); props.put(RemoteConstants.ENDPOINT_SERVICE_ID, effectiveProps.get(org.osgi.framework.Constants.SERVICE_ID)); String frameworkUUID = bctx.getProperty(org.osgi.framework.Constants.FRAMEWORK_UUID); props.put(RemoteConstants.ENDPOINT_FRAMEWORK_UUID, frameworkUUID); for (Class<?> iface : ifaces) { String pkg = iface.getPackage().getName(); props.put(RemoteConstants.ENDPOINT_PACKAGE_VERSION_ + pkg, packageUtil.getVersion(iface)); } return props; } RemoteServiceAdminCore(BundleContext context,
            BundleContext apiContext,
            EventProducer eventProducer,
            DistributionProvider provider,
            PackageUtil packageUtil); @Override @SuppressWarnings({ "rawtypes", "unchecked" }) List<ExportRegistration> exportService(ServiceReference serviceReference, Map additionalProperties); @Override Collection<ExportReference> getExportedServices(); @Override Collection<ImportReference> getImportedEndpoints(); @Override ImportRegistration importService(EndpointDescription endpoint); void close();  }
@Test public void testCreateEndpointProps() { c.replay(); Map<String, Object> sd = new HashMap<>(); sd.put(org.osgi.framework.Constants.SERVICE_ID, 42); Map<String, Object> props = rsaCore.createEndpointProps(sd, new Class[]{String.class}); Assert.assertFalse(props.containsKey(org.osgi.framework.Constants.SERVICE_ID)); assertEquals(42, props.get(RemoteConstants.ENDPOINT_SERVICE_ID)); assertEquals("some_uuid1", props.get(RemoteConstants.ENDPOINT_FRAMEWORK_UUID)); assertEquals(Arrays.asList("java.lang.String"), Arrays.asList((Object[]) props.get(org.osgi.framework.Constants.OBJECTCLASS))); assertEquals("1.0.0", props.get("endpoint.package.version.java.lang")); c.verify(); }