Sho SHIMIZU

Fix bug that a list is mistakenly added as an element of another list

Change-Id: I1e4847b572e55bbf85f99ed8ef8df96da1f7bd7f
......@@ -70,7 +70,7 @@ public final class ResourceId {
ResourceId child(Object child) {
return new ResourceId(ImmutableList.builder()
.add(components)
.addAll(components)
.add(child)
.build());
}
......
......@@ -75,6 +75,14 @@ public class ResourcePathTest {
}
@Test
public void testChild() {
ResourcePath r1 = ResourcePath.discrete(D1).child(P1);
ResourcePath sameAsR2 = ResourcePath.discrete(D1, P1);
assertThat(r1, is(sameAsR2));
}
@Test
public void testThereIsParent() {
ResourcePath path = ResourcePath.discrete(D1, P1, VLAN1);
ResourcePath parent = ResourcePath.discrete(D1, P1);
......