@Override
    public List<Intent> compile(PointToPointIntent intent, List<Intent> installable) {
        log.trace("compiling {} {}", intent, installable);
        ConnectPoint ingressPoint = intent.filteredIngressPoint().connectPoint();
        ConnectPoint egressPoint = intent.filteredEgressPoint().connectPoint();

        //TODO: handle protected path case with suggested path!!
        //Idea: use suggested path as primary and another path from path service as protection
        if (intent.suggestedPath() != null && intent.suggestedPath().size() > 0) {
            Path path = new DefaultPath(PID, intent.suggestedPath(), new ScalarWeight(1));
            //Check intent constraints against suggested path and suggested path availability
            if (checkPath(path, intent.constraints()) && pathAvailable(intent)) {
                allocateIntentBandwidth(intent, path);
                return asList(createLinkCollectionIntent(ImmutableSet.copyOf(intent.suggestedPath()),
                                                         DEFAULT_COST, intent));
            }
        }

        if (ingressPoint.deviceId().equals(egressPoint.deviceId())) {
            return createZeroHopLinkCollectionIntent(intent);
        }

        // proceed with no protected paths
        if (!ProtectionConstraint.requireProtectedPath(intent)) {
            return createUnprotectedLinkCollectionIntent(intent);
        }

        try {
            // attempt to compute and implement backup path
            return createProtectedIntent(ingressPoint, egressPoint, intent, installable);
        } catch (PathNotFoundException e) {
            log.warn("Could not find disjoint Path for {}", intent);
            // no disjoint path extant -- maximum one path exists between devices
            return createSinglePathIntent(ingressPoint, egressPoint, intent, installable);
        }
    }
@Test
    public void testSuggestedPathNotAvailable() {
        String[] suggestedPathHops = {S1, S3, S8};
        String[] shortestPath = {S1, S2, S8};
        List<Link> suggestedPath = NetTestTools.createPath(suggestedPathHops).links();

        PointToPointIntent intent = makeIntentSuggestedPath(new ConnectPoint(DID_1, PORT_1),
                                                            new ConnectPoint(DID_8, PORT_2),
                                                            suggestedPath);

        String[][] path = {shortestPath};
        PointToPointIntentCompiler compiler = makeCompilerSuggestedPath(path);

        List<Intent> result = compiler.compile(intent, null);
        assertThat(result, is(Matchers.notNullValue()));
        assertThat(result, hasSize(1));
        Intent resultIntent = result.get(0);
        assertThat(resultIntent instanceof LinkCollectionIntent, is(true));

        if (resultIntent instanceof LinkCollectionIntent) {
            LinkCollectionIntent resultLinkIntent = (LinkCollectionIntent) resultIntent;
            FilteredConnectPoint ingressPoint = new FilteredConnectPoint(new ConnectPoint(DID_1, PORT_1));
            FilteredConnectPoint egressPoint = new FilteredConnectPoint(new ConnectPoint(DID_8, PORT_2));
            // 5 links for the hops, plus one default link on ingress and egress
            assertThat(resultLinkIntent.links(), hasSize(shortestPath.length - 1));
            assertThat(resultLinkIntent.links(), linksHasPath(S1, S2));
            assertThat(resultLinkIntent.links(), linksHasPath(S2, S8));
            assertThat(resultLinkIntent.filteredIngressPoints(), is(ImmutableSet.of(ingressPoint)));
            assertThat(resultLinkIntent.filteredEgressPoints(), is(ImmutableSet.of(egressPoint)));
        }
        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
    }