package checkdep.util;

import java.util.Map;
import java.util.Optional;

import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

public class MapBase<K, V> extends ValueBase {
  private final ImmutableMap<K, V> map;

  protected MapBase(Map<K, V> map) {
    this.map = ImmutableMap.copyOf(map);
  }

  public Optional<V> get(K key) {
    return Optional.ofNullable(map.get(key));
  }

  public ImmutableSet<K> keySet() {
    return map.keySet();
  }

  public ImmutableCollection<V> values() {
    return map.values();
  }

  public boolean isEmpty() {
    return map.isEmpty();
  }
}

@@ -34,19 +34,26 @@
 va.util.
-Map
+Collection
 ;%0Aimport
@@ -67,71 +67,38 @@
 til.
-Optional;%0A%0Aimport com.google.common.collect.ImmutableCollec
+Map;%0Aimport java.util.Op
 tion
+al
 ;%0Aim
@@ -106,47 +106,23 @@
 ort 
-com.google.common.collect.ImmutableMap;
+java.util.Set;%0A
 %0Aimp
@@ -160,19 +160,19 @@
 mmutable
-Set
+Map
 ;%0A%0Apubli
@@ -431,25 +431,16 @@
  public 
-Immutable
 Set%3CK%3E k
@@ -488,25 +488,16 @@
  public 
-Immutable
 Collecti
@@ -535,32 +535,107 @@
 .values();%0A  %7D%0A%0A
+  public Set%3CMap.Entry%3CK, V%3E%3E entrySet() %7B%0A    return map.entrySet();%0A  %7D%0A%0A
   public boolean

add MapBase#entrySet()