Added move of branding jar to assembly
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / structures / Lst.java
index f5b3a5446e8f504c29f05989d9992cb2c7c448d1..d4c7671c4539bb6455b70bb15760b2bf8e355e56 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.sal.restconf.impl.test.structures;
 
 import java.util.*;
@@ -10,9 +17,13 @@ public class Lst extends YangElement {
         lstItems = new HashSet<>();
     }
 
-    public void addLstItem(LstItem lstItem) {
+    public Lst addLstItem(LstItem lstItem) {
         lstItem.setLstName(name);
+        while (this.lstItems.contains(lstItem)) {
+            lstItem.incNumOfEqualItems();
+        }
         this.lstItems.add(lstItem);
+        return this;
     }
 
     public Set<LstItem> getLstItems() {
@@ -31,7 +42,11 @@ public class Lst extends YangElement {
             return false;
         }
         Lst lst = (Lst) obj;
-        if (!this.lstItems.equals(lst.lstItems)) {
+        if (this.lstItems == null) {
+            if (lst.lstItems != null) {
+                return false;
+            }
+        } else if (!this.lstItems.equals(lst.lstItems)) {
             return false;
         }
         return true;