// Path: miniguava-base/src/main/java/net/ypresto/miniguava/base/Preconditions.java
// public static int checkPositionIndex(int index, int size) {
//   return checkPositionIndex(index, size, "index");
// }
// 
// Path: miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/ImmutableMapEntry.java
// @SuppressWarnings("unchecked") // Safe as long as the javadocs are followed
// static <K, V> ImmutableMapEntry<K, V>[] createEntryArray(int size) {
//   return new ImmutableMapEntry[size];
// }
// 
// Path: miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/ImmutableMapEntry.java
// static class NonTerminalImmutableMapEntry<K, V> extends ImmutableMapEntry<K, V> {
//   private final transient ImmutableMapEntry<K, V> nextInKeyBucket;
// 
//   NonTerminalImmutableMapEntry(K key, V value, ImmutableMapEntry<K, V> nextInKeyBucket) {
//     super(key, value);
//     this.nextInKeyBucket = nextInKeyBucket;
//   }
// 
//   @Override
//   @Nullable
//   final ImmutableMapEntry<K, V> getNextInKeyBucket() {
//     return nextInKeyBucket;
//   }
// 
//   @Override
//   final boolean isReusable() {
//     return false;
//   }
// }


import static net.ypresto.miniguava.base.Preconditions.checkPositionIndex;
import static net.ypresto.miniguava.collect.immutables.ImmutableMapEntry.createEntryArray;
import net.ypresto.miniguava.collect.immutables.ImmutableMapEntry.NonTerminalImmutableMapEntry;
import javax.annotation.Nullable;
      entries = createEntryArray(n);
    }
    int tableSize = Hashing.closedTableSize(n, MAX_LOAD_FACTOR);
    ImmutableMapEntry<K, V>[] table = createEntryArray(tableSize);
    int mask = tableSize - 1;
    for (int entryIndex = 0; entryIndex < n; entryIndex++) {
      Entry<K, V> entry = entryArray[entryIndex];
      K key = entry.getKey();
      V value = entry.getValue();
      InternalUtils.checkEntryNotNull(key, value);
      int tableIndex = Hashing.smear(key.hashCode()) & mask;
      @Nullable ImmutableMapEntry<K, V> existing = table[tableIndex];
      // prepend, not append, so the entries can be immutable
      ImmutableMapEntry<K, V> newEntry;
      if (existing == null) {
        boolean reusable =
            entry instanceof ImmutableMapEntry && ((ImmutableMapEntry<K, V>) entry).isReusable();
        newEntry =
            reusable ? (ImmutableMapEntry<K, V>) entry : new ImmutableMapEntry<K, V>(key, value);
      } else {
        newEntry = new NonTerminalImmutableMapEntry<K, V>(key, value, existing);
      }
      table[tableIndex] = newEntry;
      entries[entryIndex] = newEntry;
      checkNoConflictInKeyBucket(key, newEntry, existing);
    }
    return new RegularImmutableMap<K, V>(entries, table, mask);
  }

  private RegularImmutableMap(Entry<K, V>[] entries, ImmutableMapEntry<K, V>[] table, int mask) {
// Path: miniguava-base/src/main/java/net/ypresto/miniguava/base/Preconditions.java
// public static int checkPositionIndex(int index, int size) {
//   return checkPositionIndex(index, size, "index");
// }
// 
// Path: miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/ImmutableMapEntry.java
// @SuppressWarnings("unchecked") // Safe as long as the javadocs are followed
// static <K, V> ImmutableMapEntry<K, V>[] createEntryArray(int size) {
//   return new ImmutableMapEntry[size];
// }
// 
// Path: miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/ImmutableMapEntry.java
// static class NonTerminalImmutableMapEntry<K, V> extends ImmutableMapEntry<K, V> {
//   private final transient ImmutableMapEntry<K, V> nextInKeyBucket;
// 
//   NonTerminalImmutableMapEntry(K key, V value, ImmutableMapEntry<K, V> nextInKeyBucket) {
//     super(key, value);
//     this.nextInKeyBucket = nextInKeyBucket;
//   }
// 
//   @Override
//   @Nullable
//   final ImmutableMapEntry<K, V> getNextInKeyBucket() {
//     return nextInKeyBucket;
//   }
// 
//   @Override
//   final boolean isReusable() {
//     return false;
//   }
// }


// Path: miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/RegularImmutableMap.java
import static net.ypresto.miniguava.base.Preconditions.checkPositionIndex;
import static net.ypresto.miniguava.collect.immutables.ImmutableMapEntry.createEntryArray;
import net.ypresto.miniguava.collect.immutables.ImmutableMapEntry.NonTerminalImmutableMapEntry;
import javax.annotation.Nullable;

      entries = createEntryArray(n);
    }
    int tableSize = Hashing.closedTableSize(n, MAX_LOAD_FACTOR);
    ImmutableMapEntry<K, V>[] table = createEntryArray(tableSize);
    int mask = tableSize - 1;
    for (int entryIndex = 0; entryIndex < n; entryIndex++) {
      Entry<K, V> entry = entryArray[entryIndex];
      K key = entry.getKey();
      V value = entry.getValue();
      InternalUtils.checkEntryNotNull(key, value);
      int tableIndex = Hashing.smear(key.hashCode()) & mask;
      @Nullable ImmutableMapEntry<K, V> existing = table[tableIndex];
      // prepend, not append, so the entries can be immutable
      ImmutableMapEntry<K, V> newEntry;
      if (existing == null) {
        boolean reusable =
            entry instanceof ImmutableMapEntry && ((ImmutableMapEntry<K, V>) entry).isReusable();
        newEntry =
            reusable ? (ImmutableMapEntry<K, V>) entry : new ImmutableMapEntry<K, V>(key, value);
      } else {
        newEntry = new NonTerminalImmutableMapEntry<K, V>(key, value, existing);
      }
      table[tableIndex] = newEntry;
      entries[entryIndex] = newEntry;
      checkNoConflictInKeyBucket(key, newEntry, existing);
    }
    return new RegularImmutableMap<K, V>(entries, table, mask);
  }

  private RegularImmutableMap(Entry<K, V>[] entries, ImmutableMapEntry<K, V>[] table, int mask) {
    this.entries = entries;