+/*
+ * 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.*;
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() {
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;