Move method to IntentProcessPhase

Change-Id: Id9e898d983f3b041dbb376070ef31e36318b40c3
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java
index bef28ac..d2f9f36 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java
@@ -58,6 +58,17 @@
         }
     }
 
+    static FinalIntentProcessPhase process(IntentProcessPhase initial) {
+        Optional<IntentProcessPhase> currentPhase = Optional.of(initial);
+        IntentProcessPhase previousPhase = initial;
+
+        while (currentPhase.isPresent()) {
+            previousPhase = currentPhase.get();
+            currentPhase = previousPhase.execute();
+        }
+        return (FinalIntentProcessPhase) previousPhase;
+    }
+
     static void transferErrorCount(IntentData data, Optional<IntentData> stored) {
         stored.ifPresent(storedData -> {
             if (Objects.equals(data.intent(), storedData.intent()) &&