Fix some compiler warnings about unchecked types

Change-Id: Ib360aa05fd0e194a65bbc0b624447e4bdb4ced93
diff --git a/core/store/dist/src/test/java/org/onosproject/store/ecmap/EventuallyConsistentMapImplTest.java b/core/store/dist/src/test/java/org/onosproject/store/ecmap/EventuallyConsistentMapImplTest.java
index 951f18e..fc85795 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/ecmap/EventuallyConsistentMapImplTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/ecmap/EventuallyConsistentMapImplTest.java
@@ -155,6 +155,11 @@
         ecMap.destroy();
     }
 
+    @SuppressWarnings("unchecked")
+    private EventuallyConsistentMapListener<String, String> getListener() {
+        return createMock(EventuallyConsistentMapListener.class);
+    }
+
     @Test
     public void testSize() throws Exception {
         expectAnyMessage(clusterCommunicator);
@@ -262,7 +267,7 @@
         // Set up expectations of external events to be sent to listeners during
         // the test. These don't use timestamps so we can set them all up at once.
         EventuallyConsistentMapListener<String, String> listener
-                = createMock(EventuallyConsistentMapListener.class);
+                = getListener();
         listener.event(new EventuallyConsistentMapEvent<>(
                 EventuallyConsistentMapEvent.Type.PUT, KEY1, VALUE1));
         listener.event(new EventuallyConsistentMapEvent<>(
@@ -313,7 +318,7 @@
         // Set up expectations of external events to be sent to listeners during
         // the test. These don't use timestamps so we can set them all up at once.
         EventuallyConsistentMapListener<String, String> listener
-                = createMock(EventuallyConsistentMapListener.class);
+                = getListener();
         listener.event(new EventuallyConsistentMapEvent<>(
                 EventuallyConsistentMapEvent.Type.REMOVE, KEY1, null));
         expectLastCall().times(2);
@@ -384,7 +389,7 @@
 
         // Set up the listener with our expected events
         EventuallyConsistentMapListener<String, String> listener
-                = createMock(EventuallyConsistentMapListener.class);
+                = getListener();
         listener.event(new EventuallyConsistentMapEvent<>(
                 EventuallyConsistentMapEvent.Type.PUT, KEY1, VALUE1));
         listener.event(new EventuallyConsistentMapEvent<>(
@@ -412,7 +417,7 @@
     @Test
     public void testClear() throws Exception {
         EventuallyConsistentMapListener<String, String> listener
-                = createMock(EventuallyConsistentMapListener.class);
+                = getListener();
         listener.event(new EventuallyConsistentMapEvent<>(
                 EventuallyConsistentMapEvent.Type.REMOVE, KEY1, null));
         listener.event(new EventuallyConsistentMapEvent<>(