@Override
    public Link getLink(ConnectPoint src, ConnectPoint dst) {
        checkNotNull(src, CONNECT_POINT_NULL);
        checkNotNull(dst, CONNECT_POINT_NULL);
        Optional<VirtualLink> foundLink =  manager.getVirtualLinks(this.networkId())
                .stream()
                .filter(link -> (src.equals(link.src()) &&
                        dst.equals(link.dst())))
                .findFirst();

        if (foundLink.isPresent()) {
            return foundLink.get();
        }
        return null;
    }
@Test(expected = NullPointerException.class)
    public void testGetLinkByNullSrc() {

        manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
        VirtualNetwork virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
        VirtualDevice srcVirtualDevice =
                manager.createVirtualDevice(virtualNetwork.id(), DID1);
        VirtualDevice dstVirtualDevice =
                manager.createVirtualDevice(virtualNetwork.id(), DID2);
        ConnectPoint src = new ConnectPoint(srcVirtualDevice.id(), PortNumber.portNumber(1));
        ConnectPoint dst = new ConnectPoint(dstVirtualDevice.id(), PortNumber.portNumber(2));
        manager.createVirtualLink(virtualNetwork.id(), src, dst);
        manager.createVirtualLink(virtualNetwork.id(), dst, src);

        LinkService linkService = manager.get(virtualNetwork.id(), LinkService.class);

        // test the getLink() method with a null src connect point.
        linkService.getLink(null, dst);
    }