Fixed issue where LinkCollectionIntentInstaller was missing a flow rule
for the last hop switch.

Change-Id: I0f3d49de10dc5a6fd7cf65463d0d2e9b6d512346
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/LinkCollectionIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/LinkCollectionIntent.java
index 9d0fde8..6a8b002 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/LinkCollectionIntent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/LinkCollectionIntent.java
@@ -4,6 +4,7 @@
 import java.util.Objects;
 import java.util.Set;
 
+import org.onlab.onos.net.ConnectPoint;
 import org.onlab.onos.net.Link;
 import org.onlab.onos.net.flow.TrafficSelector;
 import org.onlab.onos.net.flow.TrafficTreatment;
@@ -18,6 +19,8 @@
 
     private final Set<Link> links;
 
+    private final ConnectPoint egressPoint;
+
     /**
      * Creates a new point-to-point intent with the supplied ingress/egress
      * ports and using the specified explicit path.
@@ -26,19 +29,23 @@
      * @param selector    traffic match
      * @param treatment   action
      * @param links       traversed links
+     * @param egressPoint egress point
      * @throws NullPointerException {@code path} is null
      */
     public LinkCollectionIntent(IntentId id,
                                 TrafficSelector selector,
                                 TrafficTreatment treatment,
-                                Set<Link> links) {
+                                Set<Link> links,
+                                ConnectPoint egressPoint) {
         super(id, selector, treatment);
         this.links = links;
+        this.egressPoint = egressPoint;
     }
 
     protected LinkCollectionIntent() {
         super();
         this.links = null;
+        this.egressPoint = null;
     }
 
     @Override
@@ -56,6 +63,15 @@
         return links;
     }
 
+    /**
+     * Returns the egress point of the intent.
+     *
+     * @return the egress point
+     */
+    public ConnectPoint egressPoint() {
+        return egressPoint;
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) {
@@ -70,12 +86,13 @@
 
         LinkCollectionIntent that = (LinkCollectionIntent) o;
 
-        return Objects.equals(this.links, that.links);
+        return Objects.equals(this.links, that.links) &&
+                Objects.equals(this.egressPoint, that.egressPoint);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(super.hashCode(), links);
+        return Objects.hash(super.hashCode(), links, egressPoint);
     }
 
     @Override
@@ -85,6 +102,7 @@
                 .add("match", selector())
                 .add("action", treatment())
                 .add("links", links())
+                .add("egress", egressPoint())
                 .toString();
     }
 }