Added a utility method to MapValue for creating tombstone instances

Change-Id: I2ddc30ebb9dac3b865a13c0a32b46b39cafb1aa8
diff --git a/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java b/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
index 7ecfbe5..23e2e5f 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
@@ -314,7 +314,7 @@
         checkState(!destroyed, destroyedMessage);
         checkNotNull(key, ERROR_NULL_KEY);
         // TODO prevent calls here if value is important for timestamp
-        MapValue<V> tombstone = new MapValue<>(null, timestampProvider.apply(key, null));
+        MapValue<V> tombstone = MapValue.tombstone(timestampProvider.apply(key, null));
         MapValue<V> previousValue = removeInternal(key, Optional.empty(), tombstone);
         if (previousValue != null) {
             notifyPeers(new UpdateEntry<>(key, tombstone), peerUpdateFunction.apply(key, previousValue.get()));
@@ -330,7 +330,7 @@
         checkState(!destroyed, destroyedMessage);
         checkNotNull(key, ERROR_NULL_KEY);
         checkNotNull(value, ERROR_NULL_VALUE);
-        MapValue<V> tombstone = new MapValue<>(null, timestampProvider.apply(key, value));
+        MapValue<V> tombstone = MapValue.tombstone(timestampProvider.apply(key, value));
         MapValue<V> previousValue = removeInternal(key, Optional.of(value), tombstone);
         if (previousValue != null) {
             notifyPeers(new UpdateEntry<>(key, tombstone), peerUpdateFunction.apply(key, previousValue.get()));
@@ -561,7 +561,7 @@
             if (remoteValueDigest != null && remoteValueDigest.isTombstone()) {
                 MapValue<V> previousValue = removeInternal(key,
                                                            Optional.empty(),
-                                                           new MapValue<>(null, remoteValueDigest.timestamp()));
+                                                           MapValue.tombstone(remoteValueDigest.timestamp()));
                 if (previousValue != null && previousValue.isAlive()) {
                     externalEvents.add(new EventuallyConsistentMapEvent<>(REMOVE, key, previousValue.get()));
                 }
diff --git a/core/store/dist/src/main/java/org/onosproject/store/ecmap/MapValue.java b/core/store/dist/src/main/java/org/onosproject/store/ecmap/MapValue.java
index 9225561..aa57962 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/ecmap/MapValue.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/ecmap/MapValue.java
@@ -12,6 +12,17 @@
     private final Timestamp timestamp;
     private final V value;
 
+    /**
+     * Creates a tombstone value with the specified timestamp.
+     * @param timestamp timestamp for tombstone
+     * @return tombstone MapValue
+     *
+     * @param <U> value type
+     */
+    public static <U> MapValue<U> tombstone(Timestamp timestamp) {
+        return new MapValue<>(null, timestamp);
+    }
+
     public MapValue(V value, Timestamp timestamp) {
         this.value = value;
         this.timestamp = timestamp;