Source:
<code>public void testBindingsMerge() { Bindings bindings = createBindings(); String zoneName = "org.wso2.foo.z1"; <START> List<Fragment> fragments1 = ImmutableList.of(createFragment("org..wso2.foo.f1"), <END> createFragment("org..wso2.foo.f2")); bindings.addBinding(zoneName, fragments1, Bindings.Mode.prepend); Assert.assertEquals(bindings.getBindings(zoneName), fragments1); List<Fragment> fragments2 = ImmutableList.of(createFragment("org..wso2.foo.f3"), createFragment("org..wso2.foo.f4")); bindings.addBinding(zoneName, fragments2, Bindings.Mode.prepend); Assert.assertEquals(bindings.getBindings(zoneName), ImmutableList.of(createFragment("org..wso2.foo.f3"), createFragment("org..wso2.foo.f4"), createFragment("org..wso2.foo.f1"), createFragment("org..wso2.foo.f2"))); List<Fragment> fragments3 = ImmutableList.of(createFragment("org..wso2.foo.f5"), createFragment("org..wso2.foo.f6")); bindings.addBinding(zoneName, fragments3, Bindings.Mode.append); Assert.assertEquals(bindings.getBindings(zoneName), ImmutableList.of(createFragment("org..wso2.foo.f3"), createFragment("org..wso2.foo.f4"), createFragment("org..wso2.foo.f1"), createFragment("org..wso2.foo.f2"), createFragment("org..wso2.foo.f5"), createFragment("org..wso2.foo.f6"))); List<Fragment> fragments4 = ImmutableList.of(createFragment("org..wso2.foo.f7"), createFragment("org..wso2.foo.f8")); bindings.addBinding(zoneName, fragments4, Bindings.Mode.overwrite); Assert.assertEquals(bindings.getBindings(zoneName), ImmutableList.of(createFragment("org..wso2.foo.f7"), createFragment("org..wso2.foo.f8"))); Assert.assertEquals(bindings.getBindings("org.wso2.foo.z2").size(), 0); }</code><technical_language>fix naming format accordingly, need ".."</technical_language>

Target:
public void testBindingsMerge() { Bindings bindings = createBindings(); String zoneName = "org.wso2.foo.z1"; List<Fragment> fragments1 = ImmutableList.of(createFragment("org.wso2.foo.f1"), createFragment("org.wso2.foo.f2")); bindings.addBinding(zoneName, fragments1, Bindings.Mode.prepend); Assert.assertEquals(bindings.getBindings(zoneName), fragments1); List<Fragment> fragments2 = ImmutableList.of(createFragment("org.wso2.foo.f3"), createFragment("org.wso2.foo.f4")); bindings.addBinding(zoneName, fragments2, Bindings.Mode.prepend); Assert.assertEquals(bindings.getBindings(zoneName), ImmutableList.of(createFragment("org.wso2.foo.f3"), createFragment("org.wso2.foo.f4"), createFragment("org.wso2.foo.f1"), createFragment("org.wso2.foo.f2"))); List<Fragment> fragments3 = ImmutableList.of(createFragment("org.wso2.foo.f5"), createFragment("org.wso2.foo.f6")); bindings.addBinding(zoneName, fragments3, Bindings.Mode.append); Assert.assertEquals(bindings.getBindings(zoneName), ImmutableList.of(createFragment("org.wso2.foo.f3"), createFragment("org.wso2.foo.f4"), createFragment("org.wso2.foo.f1"), createFragment("org.wso2.foo.f2"), createFragment("org.wso2.foo.f5"), createFragment("org.wso2.foo.f6"))); List<Fragment> fragments4 = ImmutableList.of(createFragment("org.wso2.foo.f7"), createFragment("org.wso2.foo.f8")); bindings.addBinding(zoneName, fragments4, Bindings.Mode.overwrite); Assert.assertEquals(bindings.getBindings(zoneName), ImmutableList.of(createFragment("org.wso2.foo.f7"), createFragment("org.wso2.foo.f8"))); Assert.assertEquals(bindings.getBindings("org.wso2.foo.z2").size(), 0); }