// Increase the second provider grade.
ServiceReference fs_ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooProvider2.getInstanceName());
assertNotNull("Check foo service (2) reference", fs_ref);
FooService fs = (FooService) getContext().getService(fs_ref);
fs.foo(); // Increase the grade (now = 2)
cs_ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), instance1.getInstanceName());
assertNotNull("Check CheckService availability", cs_ref);
cs = (CheckService) getContext().getService(cs_ref);
// Check grade
grade = (Integer) cs.getProps().get("int");
assertEquals("Check fourth grade", 2, grade.intValue());
// Increase the other provider grade.
fs_ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooProvider.getInstanceName());
assertNotNull("Check foo service (1) reference", fs_ref);
fs = (FooService) getContext().getService(fs_ref);
fs.foo(); //(grade = 3)
cs_ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), instance1.getInstanceName());
assertNotNull("Check CheckService availability", cs_ref);
cs = (CheckService) getContext().getService(cs_ref);
// Check grade