TestConsistentMap: cannot remove while iterating

You get concurrent modification exceptions if you do that.

Change to collecting all the keys before removing them.

Change-Id: Ie2492eaf7d5dcfd8e8261285f7ad530a686a543a
diff --git a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
index 673a531..4e25f4d 100644
--- a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
+++ b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
@@ -184,7 +184,9 @@
 
     @Override
     public void clear() {
-        map.keySet().forEach(this::remove);
+        for (K key : map.keySet().stream().collect(Collectors.toList())) {
+            remove(key);
+        }
     }
 
     @Override