2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.binding;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13 import static org.mockito.Mockito.mock;
15 import com.google.common.collect.ImmutableList;
16 import org.junit.Test;
18 public class KeyedInstanceIdentifierTest {
21 public void basicTest() {
22 final Key<?> key = mock(Key.class);
23 final KeyedInstanceIdentifier<?, ?> keyedInstanceIdentifier =
24 new KeyedInstanceIdentifier(KeyAware.class, ImmutableList.of(), false, 0, key);
26 assertEquals(key, keyedInstanceIdentifier.getKey());
28 assertFalse(keyedInstanceIdentifier.fastNonEqual(keyedInstanceIdentifier.builder().build()));
29 assertTrue(new KeyedInstanceIdentifier(KeyAware.class, ImmutableList.of(), false, 0, null)
30 .fastNonEqual(keyedInstanceIdentifier.builder().build()));