Inherit Intent Key on compilation

- Added Intent#key() method description
- Inherit key field from parent Intent during Intent
  compilation process
- Added assertion to existing unit tests

Change-Id: Iff85c5ec448b3f378957b7a20af865ad96cc3216
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java
index 60da118..ce5f3b7 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java
@@ -146,6 +146,7 @@
             assertThat(linkIntent.links(), linksHasPath("h7", "h8"));
             assertThat(linkIntent.links(), linksHasPath("h8", "egress"));
         }
+        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
     }
 
     /**
@@ -178,6 +179,7 @@
             assertThat(linkIntent.links(), linksHasPath("inner1", "inner2"));
             assertThat(linkIntent.links(), linksHasPath("inner2", "egress"));
         }
+        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
     }
 
     /**
@@ -213,6 +215,7 @@
             }
             assertThat(linkIntent.links(), linksHasPath("n1", egress));
         }
+        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
     }
 
     /**
@@ -243,6 +246,7 @@
             assertThat(linkIntent.links(), linksHasPath("i1", "i3"));
             assertThat(linkIntent.links(), linksHasPath("i2", "i3"));
         }
+        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
     }
 
     /**
@@ -280,6 +284,7 @@
             assertThat(linkIntent.links(), linksHasPath("of2", "of3"));
             assertThat(linkIntent.links(), linksHasPath("of3", "of4"));
         }
+        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
 
     }
 
@@ -323,6 +328,7 @@
             assertThat(linkIntent.links(), linksHasPath("of3", "of4"));
             assertThat(linkIntent.selector(), is(ipPrefixSelector));
         }
+        assertThat("key is inherited", resultIntent.key(), is(intent.key()));
 
     }