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/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
index f48b844..de25fda 100644
--- a/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
+++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
@@ -189,6 +189,7 @@
 
         return OpticalPathIntent.builder()
                 .appId(parentIntent.appId())
+                .key(parentIntent.key())
                 .src(parentIntent.getSrc())
                 .dst(parentIntent.getDst())
                 // calling paths.iterator().next() is safe because of non-empty set