Instance instance = impl.createInstance(null,
new HashMap<String, String>());
S1Impl s1 = (S1Impl) instance.getServiceObject();
S2 first = s1.getS2();
// The line s1.getS2() creates the link and sets the
// UnbindReceivedInstanceParameter to true, so we roll it back to false
s1.setIsBindUnbindReceivedInstanceParameter(false);
// after change the variable we expect apam to call the remove method
instance.getLinkDest("s2").setProperty("defined-property", "invalid");
S2 second = s1.getS2();
Assert.assertTrue(messageTemplate,
s1.getIsBindUnbindReceivedInstanceParameter() == true);
Assert.assertNotSame("Must be a new instance", first, second);