// Get foo object
FooService fs = (FooService) osgiHelper.getServiceObject(ref);
// Cast to POJO
Pojo pojo = (Pojo) fs;
Field im = fs.getClass().getDeclaredField("__IM");
assertNotNull(im);
im.setAccessible(true);
assertNotNull(im.get(fs));
Method method = fs.getClass().getMethod("getComponentInstance");
assertNotNull(method);
// GetComponentInstance
ComponentInstance instance = pojo.getComponentInstance();
assertNotNull(instance);
assertEquals("Check component instance name", instance.getInstanceName(), compName);
assertEquals("Check component factory name", instance.getFactory().getName(), factName);
assertNotNull("Instance description not null", instance.getInstanceDescription());
PrimitiveInstanceDescription id = (PrimitiveInstanceDescription) instance.getInstanceDescription();