IidFactory { public static InstanceIdentifier<Link> getLinkII(final InstanceIdentifier<?> path) { final LinkKey key = path.firstKeyOf(Link.class); Preconditions.checkArgument(key != null); final InstanceIdentifier<Link> link = InstanceIdentifier .builder(NetworkTopology.class) .child(Topology.class) .child(Link.class, key) .build(); return link; }  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 getLinkIITest() throws Exception { LinkKey mockLinkKey = mock(LinkKey.class); InstanceIdentifier<?> iid = InstanceIdentifier .builder(NetworkTopology.class) .child(Topology.class) .child(Link.class, mockLinkKey) .build(); assertTrue(IidFactory.getLinkII(iid) instanceof InstanceIdentifier); }