IidFactory { public static InstanceIdentifier<Node> getNodeII(final InstanceIdentifier<?> ii) { final NodeKey key = ii.firstKeyOf(Node.class); Preconditions.checkArgument(key != null); final InstanceIdentifier<Node> nodeIid = InstanceIdentifier.builder(Nodes.class) .child(Node.class, key) .build(); return nodeIid; }  static InstanceIdentifier<Node> getNodeWildII(); static InstanceIdentifier<Node> getNodeII(final InstanceIdentifier<?> ii); static NodeRef createNodeRef(InstanceIdentifier<?> path); static NodeId getNodeId(InstanceIdentifier<?> path); static InstanceIdentifier<Link> getLinkWildII(); static InstanceIdentifier<Link> getLinkII(final InstanceIdentifier<?> path); static InstanceIdentifier<Topology> getFlowTopologyII();  }
@Test public void getNodeIITest() throws Exception { NodeKey mockNodeKey = mock(NodeKey.class); InstanceIdentifier<?> iid = InstanceIdentifier.builder(Nodes.class).child(Node.class, mockNodeKey).build(); assertTrue(IidFactory.getNodeII(iid) instanceof InstanceIdentifier); }