content: /*
   * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
   */
  package com.google.common.collect;
  
  import com.google.common.annotations.GwtCompatible;
  import com.google.common.annotations.GwtIncompatible;
  import com.google.common.annotations.VisibleForTesting;
  import com.google.common.base.Preconditions;
  import com.google.common.collect.HashMultimapGwtSerializationDependencies;
  import com.google.common.collect.Multimap;
  import com.google.common.collect.Platform;
  import com.google.common.collect.Serialization;
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  import java.util.Map;
  import java.util.Set;
  
  @GwtCompatible(serializable=true, emulated=true)
  public final class HashMultimap<K, V>
  extends HashMultimapGwtSerializationDependencies<K, V> {
      private static final int DEFAULT_VALUES_PER_KEY = 2;
      @VisibleForTesting
      transient int expectedValuesPerKey = 2;
      @GwtIncompatible
      private static final long serialVersionUID = 0L;
  
      public static <K, V> HashMultimap<K, V> create() {
          return new HashMultimap<K, V>();
      }
  
      public static <K, V> HashMultimap<K, V> create(int expectedKeys, int expectedValuesPerKey) {
          return new HashMultimap<K, V>(expectedKeys, expectedValuesPerKey);
      }
  
      public static <K, V> HashMultimap<K, V> create(Multimap<? extends K, ? extends V> multimap) {
          return new HashMultimap<K, V>(multimap);
      }
  
      private HashMultimap() {
          this(12, 2);
      }
  
      private HashMultimap(int expectedKeys, int expectedValuesPerKey) {
          super(Platform.newHashMapWithExpectedSize(expectedKeys));
          Preconditions.checkArgument(expectedValuesPerKey >= 0);
          this.expectedValuesPerKey = expectedValuesPerKey;
      }
  
      private HashMultimap(Multimap<? extends K, ? extends V> multimap) {
          super(Platform.newHashMapWithExpectedSize(multimap.keySet().size()));
          this.putAll(multimap);
      }
  
      @Override
      Set<V> createCollection() {
          return Platform.newHashSetWithExpectedSize(this.expectedValuesPerKey);
      }
  
      @GwtIncompatible
      private void writeObject(ObjectOutputStream stream) throws IOException {
          stream.defaultWriteObject();
          Serialization.writeMultimap(this, stream);
      }
  
      @GwtIncompatible
      private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
          stream.defaultReadObject();
          this.expectedValuesPerKey = 2;
          int distinctKeys = Serialization.readCount(stream);
          Map map = Platform.newHashMapWithExpectedSize(12);
          this.setMap(map);
          Serialization.populateMultimap(this, stream, distinctKeys);
      }
  }
  
  