package com.google.common.collect;

import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Preconditions;

@GwtCompatible
final class CollectPreconditions {
   static void checkEntryNotNull(Object key, Object value) {
      String var2;
      if (key == null) {
         var2 = String.valueOf(String.valueOf(value));
         throw new NullPointerException((new StringBuilder(24 + var2.length())).append("null key in entry: null=").append(var2).toString());
      } else if (value == null) {
         var2 = String.valueOf(String.valueOf(key));
         throw new NullPointerException((new StringBuilder(26 + var2.length())).append("null value in entry: ").append(var2).append("=null").toString());
      }
   }

   static int checkNonnegative(int value, String name) {
      if (value < 0) {
         String var2 = String.valueOf(String.valueOf(name));
         throw new IllegalArgumentException((new StringBuilder(40 + var2.length())).append(var2).append(" cannot be negative but was: ").append(value).toString());
      } else {
         return value;
      }
   }

   static void checkRemove(boolean canRemove) {
      Preconditions.checkState(canRemove, "no calls to next() since the last call to remove()");
   }
}
