switch Guice from manually repackaging Guava to depending on Guava.  it's still jarjar'd right now, which is causing a ~400k increase in guice-snapshot.jar.  next step is to switch to ProGuard to remove the unnecessary code and cut it back down (even further?!).  this will let people build from Guice source and depend directly on Guava code without having to worry about hiding internal/util.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1558 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/build.properties b/build.properties
index d8bf543..a76a5ab 100644
--- a/build.properties
+++ b/build.properties
@@ -32,4 +32,4 @@
   com.google.inject.persist.jpa
 test.class=com.google.inject.AllTests
 module=com.google.inject
-imports=!net.sf.cglib.*,!org.objectweb.asm.*
+imports=!net.sf.cglib.*,!org.objectweb.asm.*,!com.google.common.*
diff --git a/common.xml b/common.xml
index 087f730..a1df2bc 100644
--- a/common.xml
+++ b/common.xml
@@ -120,15 +120,17 @@
   	<mkdir dir="${build.dir}/dist"/>
     <dirname property="common.basedir" file="${ant.file.common}"/>
     <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
-        classpath="${common.basedir}/lib/build/jarjar-snapshot.jar"/>
+        classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
     <jarjar jarfile="${build.dir}/${ant.project.name}-${version}-tests.jar">
       <fileset dir="${build.dir}/test"/>
       <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
       <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
       <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
       <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
-      <rule pattern="com.google.inject.internal.util.*" result="com.google.inject.internal.util.$@1"/>    	
-      <rule pattern="com.google.inject.internal.util.**.*" result="com.google.inject.internal.util.@1.$@2"/>
+      <rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
+      <rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
+      <rule pattern="javax.annotation.*.class" result="com.google.inject.internal.jsr305.$@1"/>
+      <rule pattern="javax.annotation.**.*.class" result="com.google.inject.internal.jsr305.@1.$@2"/>
       <keep pattern="com.google.inject.**"/>
       <keep pattern="com.googlecode.**"/>
     </jarjar>
@@ -139,17 +141,40 @@
     <mkdir dir="${build.dir}/dist"/>
     <dirname property="common.basedir" file="${ant.file.common}"/>
     <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
-        classpath="${common.basedir}/lib/build/jarjar-snapshot.jar"/>
+        classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
     <jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
       <fileset dir="${build.dir}/classes"/>
       <zipfileset src="${common.basedir}/lib/build/cglib-2.2.2.jar"/>
       <zipfileset src="${common.basedir}/lib/build/asm-3.3.1.jar"/>
+      <zipfileset src="${common.basedir}/lib/build/guava-r09.jar"/>
       <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
       <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
       <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
       <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
-      <rule pattern="com.google.inject.internal.util.*" result="com.google.inject.internal.util.$@1"/>    	
-      <rule pattern="com.google.inject.internal.util.**.*" result="com.google.inject.internal.util.@1.$@2"/>
+      <rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
+      <rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
+      <keep pattern="com.google.inject.**"/>
+    </jarjar>
+  </target>
+
+  <target name="jar.withrenameddeps" depends="compile"
+	      description="Build jar with dependencies embedded.">
+    <mkdir dir="${build.dir}/dist"/>
+    <dirname property="common.basedir" file="${ant.file.common}"/>
+    <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
+        classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
+    <jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
+      <zipfileset src="${common.basedir}/lib/build/cglib-2.2.2.jar">
+      	<include name="LICENSE"/>
+      	<include name="NOTICE"/>
+      </zipfileset>
+      <fileset dir="${build.dir}/classes"/>
+      <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
+      <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
+      <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
+      <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
+      <rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
+      <rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
       <keep pattern="com.google.inject.**"/>
     </jarjar>
   </target>
diff --git a/core/pom.xml b/core/pom.xml
index 99bb8f1..3df788b 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -29,6 +29,11 @@
       <version>1.0</version>
     </dependency>
     <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>r09</version>
+    </dependency>
+    <dependency>
       <groupId>cglib</groupId>
       <artifactId>cglib</artifactId>
       <version>${cglib.version}</version>
@@ -207,6 +212,8 @@
               <includes>
                 <include>*:asm</include>
                 <include>*:cglib</include>
+                <include>*:guava</include>
+                <include>*:jsr305</include>
               </includes>
             </configuration>
           </plugin>
diff --git a/core/src/com/google/inject/AbstractModule.java b/core/src/com/google/inject/AbstractModule.java
index 0d086e5..67f4470 100644
--- a/core/src/com/google/inject/AbstractModule.java
+++ b/core/src/com/google/inject/AbstractModule.java
@@ -19,8 +19,8 @@
 import com.google.inject.binder.AnnotatedBindingBuilder;
 import com.google.inject.binder.AnnotatedConstantBindingBuilder;
 import com.google.inject.binder.LinkedBindingBuilder;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.matcher.Matcher;
 import com.google.inject.spi.Message;
 import com.google.inject.spi.ProvisionListener;
diff --git a/core/src/com/google/inject/ConfigurationException.java b/core/src/com/google/inject/ConfigurationException.java
index 4b94a50..5984c3d 100644
--- a/core/src/com/google/inject/ConfigurationException.java
+++ b/core/src/com/google/inject/ConfigurationException.java
@@ -17,8 +17,8 @@
 package com.google.inject;
 
 import com.google.inject.internal.Errors;
-import com.google.inject.internal.util.ImmutableSet;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import com.google.common.collect.ImmutableSet;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.spi.Message;
 import java.util.Collection;
 
diff --git a/core/src/com/google/inject/CreationException.java b/core/src/com/google/inject/CreationException.java
index e031a61..6b8e5d2 100644
--- a/core/src/com/google/inject/CreationException.java
+++ b/core/src/com/google/inject/CreationException.java
@@ -17,8 +17,8 @@
 package com.google.inject;
 
 import com.google.inject.internal.Errors;
-import com.google.inject.internal.util.ImmutableSet;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
+import com.google.common.collect.ImmutableSet;
+import static com.google.common.base.Preconditions.checkArgument;
 import com.google.inject.spi.Message;
 import java.util.Collection;
 
diff --git a/core/src/com/google/inject/Key.java b/core/src/com/google/inject/Key.java
index 6ee1553..911bb01 100644
--- a/core/src/com/google/inject/Key.java
+++ b/core/src/com/google/inject/Key.java
@@ -18,8 +18,8 @@
 
 import com.google.inject.internal.Annotations;
 import com.google.inject.internal.MoreTypes;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 
diff --git a/core/src/com/google/inject/PrivateModule.java b/core/src/com/google/inject/PrivateModule.java
index 26aae84..2a5711c 100644
--- a/core/src/com/google/inject/PrivateModule.java
+++ b/core/src/com/google/inject/PrivateModule.java
@@ -20,7 +20,7 @@
 import com.google.inject.binder.AnnotatedConstantBindingBuilder;
 import com.google.inject.binder.AnnotatedElementBuilder;
 import com.google.inject.binder.LinkedBindingBuilder;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.matcher.Matcher;
 import com.google.inject.spi.Message;
 import com.google.inject.spi.TypeConverter;
diff --git a/core/src/com/google/inject/ProvisionException.java b/core/src/com/google/inject/ProvisionException.java
index 73e2b50..d9100b9 100644
--- a/core/src/com/google/inject/ProvisionException.java
+++ b/core/src/com/google/inject/ProvisionException.java
@@ -17,9 +17,9 @@
 package com.google.inject;
 
 import com.google.inject.internal.Errors;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import static com.google.common.base.Preconditions.checkArgument;
 import com.google.inject.spi.Message;
 import java.util.Collection;
 
diff --git a/core/src/com/google/inject/TypeLiteral.java b/core/src/com/google/inject/TypeLiteral.java
index db981ad..174404e 100644
--- a/core/src/com/google/inject/TypeLiteral.java
+++ b/core/src/com/google/inject/TypeLiteral.java
@@ -18,9 +18,9 @@
 
 import com.google.inject.internal.MoreTypes;
 import static com.google.inject.internal.MoreTypes.canonicalize;
-import com.google.inject.internal.util.ImmutableList;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableList;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.util.Types;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
diff --git a/core/src/com/google/inject/internal/AbstractBindingBuilder.java b/core/src/com/google/inject/internal/AbstractBindingBuilder.java
index e6c997f..d7d4952 100644
--- a/core/src/com/google/inject/internal/AbstractBindingBuilder.java
+++ b/core/src/com/google/inject/internal/AbstractBindingBuilder.java
@@ -19,7 +19,7 @@
 import com.google.inject.Binder;
 import com.google.inject.Key;
 import com.google.inject.Scope;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.Element;
 import com.google.inject.spi.InstanceBinding;
 import java.lang.annotation.Annotation;
diff --git a/core/src/com/google/inject/internal/AbstractBindingProcessor.java b/core/src/com/google/inject/internal/AbstractBindingProcessor.java
index fdbc752..ae4b848 100644
--- a/core/src/com/google/inject/internal/AbstractBindingProcessor.java
+++ b/core/src/com/google/inject/internal/AbstractBindingProcessor.java
@@ -28,7 +28,7 @@
 import com.google.inject.Provider;

 import com.google.inject.Scope;

 import com.google.inject.TypeLiteral;

-import com.google.inject.internal.util.ImmutableSet;

+import com.google.common.collect.ImmutableSet;

 import com.google.inject.spi.DefaultBindingTargetVisitor;

 

 /**

diff --git a/core/src/com/google/inject/internal/Annotations.java b/core/src/com/google/inject/internal/Annotations.java
index 36faa29..bf770fc 100644
--- a/core/src/com/google/inject/internal/Annotations.java
+++ b/core/src/com/google/inject/internal/Annotations.java
@@ -21,8 +21,8 @@
 import com.google.inject.ScopeAnnotation;
 import com.google.inject.TypeLiteral;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.Function;
-import com.google.inject.internal.util.MapMaker;
+import com.google.common.base.Function;
+import com.google.common.collect.MapMaker;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import java.lang.annotation.Annotation;
diff --git a/core/src/com/google/inject/internal/BindingBuilder.java b/core/src/com/google/inject/internal/BindingBuilder.java
index fa273e4..65c7b55 100644
--- a/core/src/com/google/inject/internal/BindingBuilder.java
+++ b/core/src/com/google/inject/internal/BindingBuilder.java
@@ -23,8 +23,8 @@
 import com.google.inject.TypeLiteral;
 import com.google.inject.binder.AnnotatedBindingBuilder;
 import com.google.inject.binder.ScopedBindingBuilder;
-import com.google.inject.internal.util.ImmutableSet;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableSet;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.Element;
 import com.google.inject.spi.InjectionPoint;
 import com.google.inject.spi.Message;
diff --git a/core/src/com/google/inject/internal/BindingImpl.java b/core/src/com/google/inject/internal/BindingImpl.java
index 8ae7586..9bcb7e1 100644
--- a/core/src/com/google/inject/internal/BindingImpl.java
+++ b/core/src/com/google/inject/internal/BindingImpl.java
@@ -16,10 +16,10 @@
 
 package com.google.inject.internal;
 
+import com.google.common.base.Objects;
 import com.google.inject.Binding;
 import com.google.inject.Key;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.ToStringBuilder;
 import com.google.inject.spi.BindingScopingVisitor;
 import com.google.inject.spi.ElementVisitor;
 import com.google.inject.spi.InstanceBinding;
@@ -106,7 +106,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(Binding.class)
+    return Objects.toStringHelper(Binding.class)
         .add("key", key)
         .add("scope", scoping)
         .add("source", source)
diff --git a/core/src/com/google/inject/internal/BytecodeGen.java b/core/src/com/google/inject/internal/BytecodeGen.java
index dc4a3c0..d0a14fc 100644
--- a/core/src/com/google/inject/internal/BytecodeGen.java
+++ b/core/src/com/google/inject/internal/BytecodeGen.java
@@ -16,10 +16,9 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.Function;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.MapMaker;
-import com.google.inject.internal.util.Nullable;
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.MapMaker;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Member;
@@ -132,7 +131,7 @@
     if (CUSTOM_LOADER_ENABLED) {
       CLASS_LOADER_CACHE = new MapMaker().weakKeys().weakValues().makeComputingMap(
           new Function<ClassLoader, ClassLoader>() {
-            public ClassLoader apply(final @Nullable ClassLoader typeClassLoader) {
+            public ClassLoader apply(final ClassLoader typeClassLoader) {
               logger.fine("Creating a bridge ClassLoader for " + typeClassLoader);
               return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
                 public ClassLoader run() {
diff --git a/core/src/com/google/inject/internal/ConstantBindingBuilderImpl.java b/core/src/com/google/inject/internal/ConstantBindingBuilderImpl.java
index 2298f2a..bb89a2d 100644
--- a/core/src/com/google/inject/internal/ConstantBindingBuilderImpl.java
+++ b/core/src/com/google/inject/internal/ConstantBindingBuilderImpl.java
@@ -20,7 +20,7 @@
 import com.google.inject.Key;
 import com.google.inject.binder.AnnotatedConstantBindingBuilder;
 import com.google.inject.binder.ConstantBindingBuilder;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.spi.Element;
 import com.google.inject.spi.InjectionPoint;
 import java.lang.annotation.Annotation;
diff --git a/core/src/com/google/inject/internal/ConstantFactory.java b/core/src/com/google/inject/internal/ConstantFactory.java
index 5e15b88..633d5de 100644
--- a/core/src/com/google/inject/internal/ConstantFactory.java
+++ b/core/src/com/google/inject/internal/ConstantFactory.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.base.Objects;
 import com.google.inject.spi.Dependency;
 
 /**
@@ -36,7 +36,7 @@
   }
 
   public String toString() {
-    return new ToStringBuilder(ConstantFactory.class)
+    return Objects.toStringHelper(ConstantFactory.class)
         .add("value", initializable)
         .toString();
   }
diff --git a/core/src/com/google/inject/internal/ConstructionProxy.java b/core/src/com/google/inject/internal/ConstructionProxy.java
index 7233ae5..81d4d95 100644
--- a/core/src/com/google/inject/internal/ConstructionProxy.java
+++ b/core/src/com/google/inject/internal/ConstructionProxy.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.ImmutableMap;
+import com.google.common.collect.ImmutableMap;
 import com.google.inject.spi.InjectionPoint;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
diff --git a/core/src/com/google/inject/internal/ConstructorBindingImpl.java b/core/src/com/google/inject/internal/ConstructorBindingImpl.java
index 1fafaf5..69683b8 100644
--- a/core/src/com/google/inject/internal/ConstructorBindingImpl.java
+++ b/core/src/com/google/inject/internal/ConstructorBindingImpl.java
@@ -22,10 +22,9 @@
 import com.google.inject.TypeLiteral;
 import static com.google.inject.internal.Annotations.findScopeAnnotation;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Objects;
-import static com.google.inject.internal.util.Preconditions.checkState;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Objects;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.ConstructorBinding;
 import com.google.inject.spi.Dependency;
@@ -208,7 +207,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(ConstructorBinding.class)
+    return Objects.toStringHelper(ConstructorBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .add("scope", getScoping())
diff --git a/core/src/com/google/inject/internal/ConstructorInjector.java b/core/src/com/google/inject/internal/ConstructorInjector.java
index 5944dfe..d40f465 100644
--- a/core/src/com/google/inject/internal/ConstructorInjector.java
+++ b/core/src/com/google/inject/internal/ConstructorInjector.java
@@ -17,7 +17,7 @@
 package com.google.inject.internal;
 
 import com.google.inject.internal.ProvisionListenerStackCallback.ProvisionCallback;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.spi.InjectionPoint;
 import java.lang.reflect.InvocationTargetException;
 import java.util.Set;
diff --git a/core/src/com/google/inject/internal/ConstructorInjectorStore.java b/core/src/com/google/inject/internal/ConstructorInjectorStore.java
index 2dab063..cf6db1b 100644
--- a/core/src/com/google/inject/internal/ConstructorInjectorStore.java
+++ b/core/src/com/google/inject/internal/ConstructorInjectorStore.java
@@ -16,8 +16,8 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.ImmutableList;
-import static com.google.inject.internal.util.Iterables.concat;
+import com.google.common.collect.ImmutableList;
+import static com.google.common.collect.Iterables.concat;
 import com.google.inject.spi.InjectionPoint;
 
 /**
diff --git a/core/src/com/google/inject/internal/DefaultConstructionProxyFactory.java b/core/src/com/google/inject/internal/DefaultConstructionProxyFactory.java
index 74c6756..c1a17f7 100644
--- a/core/src/com/google/inject/internal/DefaultConstructionProxyFactory.java
+++ b/core/src/com/google/inject/internal/DefaultConstructionProxyFactory.java
@@ -17,7 +17,7 @@
 package com.google.inject.internal;
 
 import com.google.inject.internal.BytecodeGen.Visibility;
-import com.google.inject.internal.util.ImmutableMap;
+import com.google.common.collect.ImmutableMap;
 import com.google.inject.spi.InjectionPoint;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
diff --git a/core/src/com/google/inject/internal/DeferredLookups.java b/core/src/com/google/inject/internal/DeferredLookups.java
index a4047cf..e4cce30 100644
--- a/core/src/com/google/inject/internal/DeferredLookups.java
+++ b/core/src/com/google/inject/internal/DeferredLookups.java
@@ -20,7 +20,7 @@
 import com.google.inject.MembersInjector;
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.Element;
 import com.google.inject.spi.MembersInjectorLookup;
 import com.google.inject.spi.ProviderLookup;
diff --git a/core/src/com/google/inject/internal/EncounterImpl.java b/core/src/com/google/inject/internal/EncounterImpl.java
index 16441f9..44770f6 100644
--- a/core/src/com/google/inject/internal/EncounterImpl.java
+++ b/core/src/com/google/inject/internal/EncounterImpl.java
@@ -20,9 +20,9 @@
 import com.google.inject.MembersInjector;
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.matcher.Matcher;
 import com.google.inject.matcher.Matchers;
 import com.google.inject.spi.InjectionListener;
diff --git a/core/src/com/google/inject/internal/Errors.java b/core/src/com/google/inject/internal/Errors.java
index 3e5134a..c89e025 100644
--- a/core/src/com/google/inject/internal/Errors.java
+++ b/core/src/com/google/inject/internal/Errors.java
@@ -25,9 +25,9 @@
 import com.google.inject.Scope;
 import com.google.inject.TypeLiteral;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import com.google.inject.internal.util.SourceProvider;
 import com.google.inject.internal.util.StackTraceElements;
 import com.google.inject.spi.Dependency;
diff --git a/core/src/com/google/inject/internal/ExposedBindingImpl.java b/core/src/com/google/inject/internal/ExposedBindingImpl.java
index 92c1c23..6f70d03 100644
--- a/core/src/com/google/inject/internal/ExposedBindingImpl.java
+++ b/core/src/com/google/inject/internal/ExposedBindingImpl.java
@@ -19,8 +19,8 @@
 import com.google.inject.Binder;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.ExposedBinding;
@@ -50,7 +50,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(ExposedBinding.class)
+    return Objects.toStringHelper(ExposedBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .add("privateElements", privateElements)
diff --git a/core/src/com/google/inject/internal/ExposureBuilder.java b/core/src/com/google/inject/internal/ExposureBuilder.java
index f5c943c..3f4bcd5 100644
--- a/core/src/com/google/inject/internal/ExposureBuilder.java
+++ b/core/src/com/google/inject/internal/ExposureBuilder.java
@@ -19,7 +19,7 @@
 import com.google.inject.Binder;
 import com.google.inject.Key;
 import com.google.inject.binder.AnnotatedElementBuilder;
-import com.google.inject.internal.util.Preconditions;
+import com.google.common.base.Preconditions;
 import java.lang.annotation.Annotation;
 
 /**
diff --git a/core/src/com/google/inject/internal/FactoryProxy.java b/core/src/com/google/inject/internal/FactoryProxy.java
index 7b0387f..6416d26 100644
--- a/core/src/com/google/inject/internal/FactoryProxy.java
+++ b/core/src/com/google/inject/internal/FactoryProxy.java
@@ -16,9 +16,9 @@
 
 package com.google.inject.internal;
 
+import com.google.common.base.Objects;
 import com.google.inject.Key;
 import com.google.inject.internal.InjectorImpl.JitLimitation;
-import com.google.inject.internal.util.ToStringBuilder;
 import com.google.inject.spi.Dependency;
 
 /**
@@ -60,7 +60,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(FactoryProxy.class)
+    return Objects.toStringHelper(FactoryProxy.class)
         .add("key", key)
         .add("provider", targetFactory)
         .toString();
diff --git a/core/src/com/google/inject/internal/FailableCache.java b/core/src/com/google/inject/internal/FailableCache.java
index 96fb922..e392e0d 100644
--- a/core/src/com/google/inject/internal/FailableCache.java
+++ b/core/src/com/google/inject/internal/FailableCache.java
@@ -16,9 +16,8 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.Function;
-import com.google.inject.internal.util.MapMaker;
-import com.google.inject.internal.util.Nullable;
+import com.google.common.base.Function;
+import com.google.common.collect.MapMaker;
 
 import java.util.Map;
 
@@ -32,7 +31,7 @@
   
   private final Map<K, Object> delegate = new MapMaker().makeComputingMap(
       new Function<K, Object>() {
-        public Object apply(@Nullable K key) {
+        public Object apply(K key) {
           Errors errors = new Errors();
           V result = null;
           try {
diff --git a/core/src/com/google/inject/internal/InheritingState.java b/core/src/com/google/inject/internal/InheritingState.java
index 7efd1ff..a729d56 100644
--- a/core/src/com/google/inject/internal/InheritingState.java
+++ b/core/src/com/google/inject/internal/InheritingState.java
@@ -20,10 +20,10 @@
 import com.google.inject.Key;
 import com.google.inject.Scope;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 import com.google.inject.spi.ProvisionListenerBinding;
 import com.google.inject.spi.TypeConverterBinding;
diff --git a/core/src/com/google/inject/internal/Initializer.java b/core/src/com/google/inject/internal/Initializer.java
index 7c53a89..51b116e 100644
--- a/core/src/com/google/inject/internal/Initializer.java
+++ b/core/src/com/google/inject/internal/Initializer.java
@@ -19,9 +19,9 @@
 import com.google.inject.Key;
 import com.google.inject.Stage;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.InjectionPoint;
 import java.util.Map;
 import java.util.Set;
diff --git a/core/src/com/google/inject/internal/InjectionRequestProcessor.java b/core/src/com/google/inject/internal/InjectionRequestProcessor.java
index 7450bb7..455419b 100644
--- a/core/src/com/google/inject/internal/InjectionRequestProcessor.java
+++ b/core/src/com/google/inject/internal/InjectionRequestProcessor.java
@@ -18,8 +18,8 @@
 
 import com.google.inject.ConfigurationException;
 import com.google.inject.Stage;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.InjectionPoint;
 import com.google.inject.spi.InjectionRequest;
 import com.google.inject.spi.StaticInjectionRequest;
diff --git a/core/src/com/google/inject/internal/InjectorImpl.java b/core/src/com/google/inject/internal/InjectorImpl.java
index 21e7bbf..3c7bcdb 100644
--- a/core/src/com/google/inject/internal/InjectorImpl.java
+++ b/core/src/com/google/inject/internal/InjectorImpl.java
@@ -30,15 +30,13 @@
 import com.google.inject.Scope;
 import com.google.inject.Stage;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Nullable;
-import com.google.inject.internal.util.Objects;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.base.Objects;
 import com.google.inject.internal.util.SourceProvider;
-import com.google.inject.internal.util.ToStringBuilder;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.ConvertedConstantBinding;
 import com.google.inject.spi.Dependency;
@@ -80,7 +78,7 @@
     
     @Override
     public String toString() {
-      return new ToStringBuilder(getClass())
+      return Objects.toStringHelper(getClass())
           .add("stage", stage)
           .add("jitDisabled", jitDisabled)
           .add("disableCircularProxies", disableCircularProxies)
@@ -108,7 +106,7 @@
 
   Lookups lookups = new DeferredLookups(this);
 
-  InjectorImpl(@Nullable InjectorImpl parent, State state, InjectorOptions injectorOptions) {
+  InjectorImpl(InjectorImpl parent, State state, InjectorOptions injectorOptions) {
     this.parent = parent;
     this.state = state;
     this.options = injectorOptions;
@@ -350,7 +348,7 @@
     }
 
     @Override public String toString() {
-      return new ToStringBuilder(ProviderBinding.class)
+      return Objects.toStringHelper(ProviderBinding.class)
           .add("key", getKey())
           .add("providedKey", getProvidedKey())
           .toString();
@@ -477,7 +475,7 @@
     }
 
     @Override public String toString() {
-      return new ToStringBuilder(ConvertedConstantBinding.class)
+      return Objects.toStringHelper(ConvertedConstantBinding.class)
           .add("key", getKey())
           .add("sourceKey", getSourceKey())
           .add("value", value)
@@ -1021,7 +1019,7 @@
   }
 
   public String toString() {
-    return new ToStringBuilder(Injector.class)
+    return Objects.toStringHelper(Injector.class)
         .add("bindings", state.getExplicitBindingsThisLevel().values())
         .toString();
   }
diff --git a/core/src/com/google/inject/internal/InjectorOptionsProcessor.java b/core/src/com/google/inject/internal/InjectorOptionsProcessor.java
index f1ff0eb..34abc5c 100644
--- a/core/src/com/google/inject/internal/InjectorOptionsProcessor.java
+++ b/core/src/com/google/inject/internal/InjectorOptionsProcessor.java
@@ -16,8 +16,8 @@
 

 package com.google.inject.internal;

 

-import static com.google.inject.internal.util.Preconditions.checkNotNull;

-import static com.google.inject.internal.util.Preconditions.checkState;

+import static com.google.common.base.Preconditions.checkNotNull;

+import static com.google.common.base.Preconditions.checkState;

 

 import com.google.inject.Stage;

 import com.google.inject.internal.InjectorImpl.InjectorOptions;

diff --git a/core/src/com/google/inject/internal/InjectorShell.java b/core/src/com/google/inject/internal/InjectorShell.java
index 7bdd34b..ebb286e 100644
--- a/core/src/com/google/inject/internal/InjectorShell.java
+++ b/core/src/com/google/inject/internal/InjectorShell.java
@@ -25,10 +25,10 @@
 import com.google.inject.Singleton;
 import com.google.inject.Stage;
 import com.google.inject.internal.InjectorImpl.InjectorOptions;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.internal.util.SourceProvider;
 import com.google.inject.internal.util.Stopwatch;
 import com.google.inject.spi.Dependency;
diff --git a/core/src/com/google/inject/internal/InstanceBindingImpl.java b/core/src/com/google/inject/internal/InstanceBindingImpl.java
index c99830c..f57c32d 100644
--- a/core/src/com/google/inject/internal/InstanceBindingImpl.java
+++ b/core/src/com/google/inject/internal/InstanceBindingImpl.java
@@ -19,9 +19,8 @@
 import com.google.inject.Binder;
 import com.google.inject.Key;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Objects;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Objects;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
@@ -89,7 +88,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(InstanceBinding.class)
+    return Objects.toStringHelper(InstanceBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .add("instance", instance)
diff --git a/core/src/com/google/inject/internal/InterceptorStackCallback.java b/core/src/com/google/inject/internal/InterceptorStackCallback.java
index 1e1e4d3..74143bf 100644
--- a/core/src/com/google/inject/internal/InterceptorStackCallback.java
+++ b/core/src/com/google/inject/internal/InterceptorStackCallback.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Method;
 import java.util.Arrays;
diff --git a/core/src/com/google/inject/internal/InternalContext.java b/core/src/com/google/inject/internal/InternalContext.java
index 59cd801..2d9fab2 100644
--- a/core/src/com/google/inject/internal/InternalContext.java
+++ b/core/src/com/google/inject/internal/InternalContext.java
@@ -17,8 +17,8 @@
 package com.google.inject.internal;
 
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.DependencyAndSource;
 
diff --git a/core/src/com/google/inject/internal/InternalFactoryToInitializableAdapter.java b/core/src/com/google/inject/internal/InternalFactoryToInitializableAdapter.java
index 289aa96..fa1519f 100644
--- a/core/src/com/google/inject/internal/InternalFactoryToInitializableAdapter.java
+++ b/core/src/com/google/inject/internal/InternalFactoryToInitializableAdapter.java
@@ -17,7 +17,7 @@
 package com.google.inject.internal;
 
 import com.google.inject.Provider;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.ProviderInstanceBinding;
 
diff --git a/core/src/com/google/inject/internal/InternalFactoryToProviderAdapter.java b/core/src/com/google/inject/internal/InternalFactoryToProviderAdapter.java
index 28a4288..d400167 100644
--- a/core/src/com/google/inject/internal/InternalFactoryToProviderAdapter.java
+++ b/core/src/com/google/inject/internal/InternalFactoryToProviderAdapter.java
@@ -17,7 +17,7 @@
 package com.google.inject.internal;
 
 import com.google.inject.Provider;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.Dependency;
 
 /**
diff --git a/core/src/com/google/inject/internal/InternalInjectorCreator.java b/core/src/com/google/inject/internal/InternalInjectorCreator.java
index a1cbcff..a657003 100644
--- a/core/src/com/google/inject/internal/InternalInjectorCreator.java
+++ b/core/src/com/google/inject/internal/InternalInjectorCreator.java
@@ -25,8 +25,8 @@
 import com.google.inject.Scope;
 import com.google.inject.Stage;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
 import com.google.inject.internal.util.Stopwatch;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.TypeConverterBinding;
diff --git a/core/src/com/google/inject/internal/LinkedBindingImpl.java b/core/src/com/google/inject/internal/LinkedBindingImpl.java
index e306c84..dca0342 100644
--- a/core/src/com/google/inject/internal/LinkedBindingImpl.java
+++ b/core/src/com/google/inject/internal/LinkedBindingImpl.java
@@ -18,9 +18,8 @@
 
 import com.google.inject.Binder;
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Objects;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Objects;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
@@ -68,7 +67,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(LinkedKeyBinding.class)
+    return Objects.toStringHelper(LinkedKeyBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .add("scope", getScoping())
diff --git a/core/src/com/google/inject/internal/LinkedProviderBindingImpl.java b/core/src/com/google/inject/internal/LinkedProviderBindingImpl.java
index d7a8599..e15dfc6 100644
--- a/core/src/com/google/inject/internal/LinkedProviderBindingImpl.java
+++ b/core/src/com/google/inject/internal/LinkedProviderBindingImpl.java
@@ -18,9 +18,8 @@
 
 import com.google.inject.Binder;
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Objects;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Objects;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
@@ -95,7 +94,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(ProviderKeyBinding.class)
+    return Objects.toStringHelper(ProviderKeyBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .add("scope", getScoping())
diff --git a/core/src/com/google/inject/internal/MembersInjectorImpl.java b/core/src/com/google/inject/internal/MembersInjectorImpl.java
index 6e71b41..6b6303a 100644
--- a/core/src/com/google/inject/internal/MembersInjectorImpl.java
+++ b/core/src/com/google/inject/internal/MembersInjectorImpl.java
@@ -19,8 +19,8 @@
 import com.google.inject.Key;
 import com.google.inject.MembersInjector;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.spi.InjectionListener;
 import com.google.inject.spi.InjectionPoint;
 
diff --git a/core/src/com/google/inject/internal/MembersInjectorStore.java b/core/src/com/google/inject/internal/MembersInjectorStore.java
index a8eb427..658f17b 100644
--- a/core/src/com/google/inject/internal/MembersInjectorStore.java
+++ b/core/src/com/google/inject/internal/MembersInjectorStore.java
@@ -18,8 +18,8 @@
 
 import com.google.inject.ConfigurationException;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.InjectionPoint;
 import com.google.inject.spi.TypeListenerBinding;
 import java.lang.reflect.Field;
diff --git a/core/src/com/google/inject/internal/MethodAspect.java b/core/src/com/google/inject/internal/MethodAspect.java
index 439491e..6b84f48 100644
--- a/core/src/com/google/inject/internal/MethodAspect.java
+++ b/core/src/com/google/inject/internal/MethodAspect.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal;
 
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.matcher.Matcher;
 import java.lang.reflect.Method;
 import java.util.Arrays;
diff --git a/core/src/com/google/inject/internal/MoreTypes.java b/core/src/com/google/inject/internal/MoreTypes.java
index 0fb5740..f0c1067 100644
--- a/core/src/com/google/inject/internal/MoreTypes.java
+++ b/core/src/com/google/inject/internal/MoreTypes.java
@@ -19,10 +19,10 @@
 
 import com.google.inject.ConfigurationException;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Objects;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.base.Objects;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.util.Types;
 import java.io.Serializable;
 import java.lang.reflect.Array;
diff --git a/core/src/com/google/inject/internal/Nullability.java b/core/src/com/google/inject/internal/Nullability.java
index 2e88ec4..f90342e 100644
--- a/core/src/com/google/inject/internal/Nullability.java
+++ b/core/src/com/google/inject/internal/Nullability.java
@@ -2,8 +2,6 @@
 
 import java.lang.annotation.Annotation;
 
-import com.google.inject.internal.util.Nullable;
-
 /**
  * Whether a member supports null values injected.
  *
@@ -25,10 +23,7 @@
   public static boolean allowsNull(Annotation[] annotations) {
     for(Annotation a : annotations) {
       Class<? extends Annotation> type = a.annotationType();
-      // Check for Nullable.class because our c.g.i.internal.util.Nullable
-      // gets jarjar'd into $Nullable, and we want extensions that reference
-      // it to continue working.
-      if ("Nullable".equals(type.getSimpleName()) || type == Nullable.class) {
+      if ("Nullable".equals(type.getSimpleName())) {
         return true;
       }
     }
diff --git a/core/src/com/google/inject/internal/PrivateElementProcessor.java b/core/src/com/google/inject/internal/PrivateElementProcessor.java
index 9494856..98454bd 100644
--- a/core/src/com/google/inject/internal/PrivateElementProcessor.java
+++ b/core/src/com/google/inject/internal/PrivateElementProcessor.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal;
 
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.PrivateElements;
 import java.util.List;
 
diff --git a/core/src/com/google/inject/internal/PrivateElementsImpl.java b/core/src/com/google/inject/internal/PrivateElementsImpl.java
index 1a05ab1..c5dae6d 100644
--- a/core/src/com/google/inject/internal/PrivateElementsImpl.java
+++ b/core/src/com/google/inject/internal/PrivateElementsImpl.java
@@ -20,14 +20,14 @@
 import com.google.inject.Injector;
 import com.google.inject.Key;
 import com.google.inject.PrivateBinder;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
-import static com.google.inject.internal.util.Preconditions.checkState;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 import com.google.inject.spi.Element;
 import com.google.inject.spi.ElementVisitor;
 import com.google.inject.spi.PrivateElements;
@@ -130,7 +130,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(PrivateElements.class)
+    return Objects.toStringHelper(PrivateElements.class)
         .add("exposedKeys", getExposedKeys())
         .add("source", getSource())
         .toString();
diff --git a/core/src/com/google/inject/internal/ProcessedBindingData.java b/core/src/com/google/inject/internal/ProcessedBindingData.java
index cf311a7..4ab420d 100644
--- a/core/src/com/google/inject/internal/ProcessedBindingData.java
+++ b/core/src/com/google/inject/internal/ProcessedBindingData.java
@@ -18,7 +18,7 @@
 

 import java.util.List;

 

-import com.google.inject.internal.util.Lists;

+import com.google.common.collect.Lists;

 

 /**

  * Keeps track of creation listeners & uninitialized bindings,

diff --git a/core/src/com/google/inject/internal/ProvidedByInternalFactory.java b/core/src/com/google/inject/internal/ProvidedByInternalFactory.java
index fa03ec4..c1298c3 100644
--- a/core/src/com/google/inject/internal/ProvidedByInternalFactory.java
+++ b/core/src/com/google/inject/internal/ProvidedByInternalFactory.java
@@ -17,7 +17,7 @@
 
 package com.google.inject.internal;
 
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.base.Preconditions.checkState;
 
 import com.google.inject.Key;
 import com.google.inject.ProvidedBy;
diff --git a/core/src/com/google/inject/internal/ProviderInstanceBindingImpl.java b/core/src/com/google/inject/internal/ProviderInstanceBindingImpl.java
index 2546c26..677508d 100644
--- a/core/src/com/google/inject/internal/ProviderInstanceBindingImpl.java
+++ b/core/src/com/google/inject/internal/ProviderInstanceBindingImpl.java
@@ -19,9 +19,8 @@
 import com.google.inject.Binder;
 import com.google.inject.Key;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Objects;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Objects;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
@@ -94,7 +93,7 @@
 
   @Override
   public String toString() {
-    return new ToStringBuilder(ProviderInstanceBinding.class)
+    return Objects.toStringHelper(ProviderInstanceBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .add("scope", getScoping())
diff --git a/core/src/com/google/inject/internal/ProviderInternalFactory.java b/core/src/com/google/inject/internal/ProviderInternalFactory.java
index a88a57f..db0ca19 100644
--- a/core/src/com/google/inject/internal/ProviderInternalFactory.java
+++ b/core/src/com/google/inject/internal/ProviderInternalFactory.java
@@ -17,7 +17,7 @@
 

 package com.google.inject.internal;

 

-import static com.google.inject.internal.util.Preconditions.checkNotNull;

+import static com.google.common.base.Preconditions.checkNotNull;

 

 import javax.inject.Provider;

 import com.google.inject.internal.ProvisionListenerStackCallback.ProvisionCallback;

diff --git a/core/src/com/google/inject/internal/ProviderMethod.java b/core/src/com/google/inject/internal/ProviderMethod.java
index 163c453..2e34197 100644
--- a/core/src/com/google/inject/internal/ProviderMethod.java
+++ b/core/src/com/google/inject/internal/ProviderMethod.java
@@ -21,8 +21,8 @@
 import com.google.inject.Key;
 import com.google.inject.PrivateBinder;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Objects;
 import com.google.inject.internal.util.StackTraceElements;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.ProviderWithDependencies;
diff --git a/core/src/com/google/inject/internal/ProviderMethodsModule.java b/core/src/com/google/inject/internal/ProviderMethodsModule.java
index dd30d92..fcfbcab 100644
--- a/core/src/com/google/inject/internal/ProviderMethodsModule.java
+++ b/core/src/com/google/inject/internal/ProviderMethodsModule.java
@@ -22,9 +22,9 @@
 import com.google.inject.Provider;
 import com.google.inject.Provides;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.Message;
 import com.google.inject.util.Modules;
diff --git a/core/src/com/google/inject/internal/ProvisionListenerCallbackStore.java b/core/src/com/google/inject/internal/ProvisionListenerCallbackStore.java
index 6b82ae5..9694b24 100644
--- a/core/src/com/google/inject/internal/ProvisionListenerCallbackStore.java
+++ b/core/src/com/google/inject/internal/ProvisionListenerCallbackStore.java
@@ -20,10 +20,10 @@
 import java.util.Map;

 

 import com.google.inject.Key;

-import com.google.inject.internal.util.Function;

-import com.google.inject.internal.util.ImmutableList;

-import com.google.inject.internal.util.Lists;

-import com.google.inject.internal.util.MapMaker;

+import com.google.common.base.Function;

+import com.google.common.collect.ImmutableList;

+import com.google.common.collect.Lists;

+import com.google.common.collect.MapMaker;

 import com.google.inject.spi.ProvisionListener;

 import com.google.inject.spi.ProvisionListenerBinding;

 

diff --git a/core/src/com/google/inject/internal/ProxyFactory.java b/core/src/com/google/inject/internal/ProxyFactory.java
index 97c3893..12d386c 100644
--- a/core/src/com/google/inject/internal/ProxyFactory.java
+++ b/core/src/com/google/inject/internal/ProxyFactory.java
@@ -17,10 +17,10 @@
 package com.google.inject.internal;
 
 import static com.google.inject.internal.BytecodeGen.newFastClass;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.google.inject.spi.InjectionPoint;
 
 import java.lang.reflect.Constructor;
diff --git a/core/src/com/google/inject/internal/ScopeBindingProcessor.java b/core/src/com/google/inject/internal/ScopeBindingProcessor.java
index 7c2ac61..a7d83c5 100644
--- a/core/src/com/google/inject/internal/ScopeBindingProcessor.java
+++ b/core/src/com/google/inject/internal/ScopeBindingProcessor.java
@@ -17,7 +17,7 @@
 package com.google.inject.internal;
 
 import com.google.inject.Scope;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.ScopeBinding;
 import java.lang.annotation.Annotation;
 
diff --git a/core/src/com/google/inject/internal/Scoping.java b/core/src/com/google/inject/internal/Scoping.java
index 0ff2aca..eb54d5e 100644
--- a/core/src/com/google/inject/internal/Scoping.java
+++ b/core/src/com/google/inject/internal/Scoping.java
@@ -23,7 +23,7 @@
 import com.google.inject.Singleton;
 import com.google.inject.Stage;
 import com.google.inject.binder.ScopedBindingBuilder;
-import com.google.inject.internal.util.Objects;
+import com.google.common.base.Objects;
 import com.google.inject.spi.BindingScopingVisitor;
 import java.lang.annotation.Annotation;
 
diff --git a/core/src/com/google/inject/internal/State.java b/core/src/com/google/inject/internal/State.java
index c270d15..44aea7e 100644
--- a/core/src/com/google/inject/internal/State.java
+++ b/core/src/com/google/inject/internal/State.java
@@ -20,9 +20,9 @@
 import com.google.inject.Key;
 import com.google.inject.Scope;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.spi.ProvisionListenerBinding;
 import com.google.inject.spi.TypeConverterBinding;
 import com.google.inject.spi.TypeListenerBinding;
diff --git a/core/src/com/google/inject/internal/TypeConverterBindingProcessor.java b/core/src/com/google/inject/internal/TypeConverterBindingProcessor.java
index ceb0657..0208aea 100644
--- a/core/src/com/google/inject/internal/TypeConverterBindingProcessor.java
+++ b/core/src/com/google/inject/internal/TypeConverterBindingProcessor.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.TypeLiteral;
 import com.google.inject.internal.util.SourceProvider;
-import com.google.inject.internal.util.Strings;
+import com.google.common.base.Strings;
 import com.google.inject.matcher.AbstractMatcher;
 import com.google.inject.matcher.Matcher;
 import com.google.inject.matcher.Matchers;
@@ -111,7 +111,7 @@
   private <T> void convertToPrimitiveType(Class<T> primitiveType, final Class<T> wrapperType) {
     try {
       final Method parser = wrapperType.getMethod(
-          "parse" + Strings.capitalize(primitiveType.getName()), String.class);
+          "parse" + capitalize(primitiveType.getName()), String.class);
 
       TypeConverter typeConverter = new TypeConverter() {
         @SuppressWarnings("unchecked")
@@ -169,4 +169,16 @@
         command.getSource(), command.getTypeMatcher(), command.getTypeConverter()));
     return true;
   }
+  
+  private static String capitalize(String s) {
+    if (s.length() == 0) {
+      return s;
+    }
+    char first = s.charAt(0);
+    char capitalized = Character.toUpperCase(first);
+    return (first == capitalized)
+        ? s
+        : capitalized + s.substring(1);
+  }
+
 }
diff --git a/core/src/com/google/inject/internal/UntargettedBindingImpl.java b/core/src/com/google/inject/internal/UntargettedBindingImpl.java
index 19bd2f0..99a70cf 100644
--- a/core/src/com/google/inject/internal/UntargettedBindingImpl.java
+++ b/core/src/com/google/inject/internal/UntargettedBindingImpl.java
@@ -18,8 +18,7 @@
 
 import com.google.inject.Binder;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Objects;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.base.Objects;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.UntargettedBinding;
@@ -55,7 +54,7 @@
   }
 
   @Override public String toString() {
-    return new ToStringBuilder(UntargettedBinding.class)
+    return Objects.toStringHelper(UntargettedBinding.class)
         .add("key", getKey())
         .add("source", getSource())
         .toString();
diff --git a/core/src/com/google/inject/internal/WeakKeySet.java b/core/src/com/google/inject/internal/WeakKeySet.java
index 4ee87e7..2c62eca 100644
--- a/core/src/com/google/inject/internal/WeakKeySet.java
+++ b/core/src/com/google/inject/internal/WeakKeySet.java
@@ -17,8 +17,8 @@
 package com.google.inject.internal;
 
 import com.google.inject.Key;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.google.inject.internal.util.SourceProvider;
 
 import java.util.Map;
diff --git a/core/src/com/google/inject/internal/util/AbstractIterator.java b/core/src/com/google/inject/internal/util/AbstractIterator.java
deleted file mode 100644
index 0686b23..0000000
--- a/core/src/com/google/inject/internal/util/AbstractIterator.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class provides a skeletal implementation of the {@code Iterator}
- * interface, to make this interface easier to implement for certain types of
- * data sources.
- *
- * <p>{@code Iterator} requires its implementations to support querying the
- * end-of-data status without changing the iterator's state, using the {@link
- * #hasNext} method. But many data sources, such as {@link
- * java.io.Reader#read()}), do not expose this information; the only way to
- * discover whether there is any data left is by trying to retrieve it. These
- * types of data sources are ordinarily difficult to write iterators for. But
- * using this class, one must implement only the {@link #computeNext} method,
- * and invoke the {@link #endOfData} method when appropriate.
- *
- * <p>Another example is an iterator that skips over null elements in a backing
- * iterator. This could be implemented as: <pre>   {@code
- *
- *   public static Iterator<String> skipNulls(final Iterator<String> in) {
- *     return new AbstractIterator<String>() {
- *       protected String computeNext() {
- *         while (in.hasNext()) {
- *           String s = in.next();
- *           if (s != null) {
- *             return s;
- *           }
- *         }
- *         return endOfData();
- *       }
- *     };
- *   }}</pre>
- *
- * This class supports iterators that include null elements. The {@link
- * #remove()} method throws an {@link UnsupportedOperationException}, but
- * this can be overridden to support removal.
- *
- * @author Kevin Bourrillion
- */
-public abstract class AbstractIterator<T> implements Iterator<T> {
-  private State state = State.NOT_READY;
-
-  private enum State {
-    /** We have computed the next element and haven't returned it yet. */
-    READY,
-
-    /** We haven't yet computed or have already returned the element. */
-    NOT_READY,
-
-    /** We have reached the end of the data and are finished. */
-    DONE,
-
-    /** We've suffered an exception and are kaput. */
-    FAILED,
-  }
-
-  private T next;
-
-  /**
-   * Returns the next element. <b>Note:</b> the implementation must call {@link
-   * #endOfData} when there are no elements left in the iteration. Failure to do
-   * so could result in an infinite loop.
-   *
-   * <p>The initial invocation of {@link #hasNext()} or {@link #next()} calls
-   * this method, as does the first invocation of {@code hasNext} or
-   * {@code next} following each successful call to {@code next}. Once the
-   * implementation either invokes {@code endOfData} or throws an exception,
-   * {@code computeNext} is guaranteed to never be called again.
-   *
-   * <p>If this method throws an exception, it will propagate outward to the
-   * {@code hasNext()} or {@code next()} invocation that invoked this method.
-   * Any further attempts to use the iterator will result in an {@link
-   * IllegalStateException}.
-   *
-   * @return the next element if there was one. If {@code endOfData} was called
-   *     during execution, the return value will be ignored.
-   * @throws RuntimeException if any unrecoverable error happens. This exception
-   *     will propagate outward to the {@code hasNext()}, {@code next()}, or
-   *     {@code peek()} invocation that invoked this method. Any further
-   *     attempts to use the iterator will result in an
-   *     {@link IllegalStateException}.
-   */
-  protected abstract T computeNext();
-
-  /**
-   * Implementations of {@code computeNext} <b>must</b> invoke this method when
-   * there are no elements left in the iteration.
-   *
-   * @return {@code null}; a convenience so your {@link #computeNext}
-   *     implementation can use the simple statement {@code return endOfData();}
-   */
-  protected final T endOfData() {
-    state = State.DONE;
-    return null;
-  }
-
-  public boolean hasNext() {
-    Preconditions.checkState(state != State.FAILED);
-    switch (state) {
-      case DONE:
-        return false;
-      case READY:
-        return true;
-      default:
-    }
-    return tryToComputeNext();
-  }
-
-  private boolean tryToComputeNext() {
-    state = State.FAILED; // temporary pessimism
-    next = computeNext();
-    if (state != State.DONE) {
-      state = State.READY;
-      return true;
-    }
-    return false;
-  }
-
-  public T next() {
-    if (!hasNext()) {
-      throw new NoSuchElementException();
-    }
-    state = State.NOT_READY;
-    return next;
-  }
-
-  /**
-   * This method is not supported.
-   */
-  public void remove() {
-    throw new UnsupportedOperationException();
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/AbstractMapEntry.java b/core/src/com/google/inject/internal/util/AbstractMapEntry.java
deleted file mode 100644
index fa8c1d9..0000000
--- a/core/src/com/google/inject/internal/util/AbstractMapEntry.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Map.Entry;
-
-/**
- * Implementation of the {@code equals}, {@code hashCode}, and {@code toString}
- * methods of {@code Entry}.
- *
- * @author Jared Levy
- */
-public abstract class AbstractMapEntry<K, V> implements Entry<K, V> {
-
-  public abstract K getKey();
-
-  public abstract V getValue();
-
-  /**
-   * {@inheritDoc}
-   *
-   * <p>This implementation throws an {@link UnsupportedOperationException}.
-   * Override this method to support mutable map entries.
-   */
-  public V setValue(V value) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Indicates whether an object equals this entry, following the behavior
-   * specified in {@link Entry#equals}.
-   */
-  @Override public boolean equals(@Nullable Object object) {
-    if (object instanceof Entry) {
-      Entry<?, ?> that = (Entry<?, ?>) object;
-      return Objects.equal(this.getKey(), that.getKey())
-          && Objects.equal(this.getValue(), that.getValue());
-    }
-    return false;
-  }
-
-  /**
-   * Return this entry's hash code, following the behavior specified in
-   * {@link Entry#hashCode}.
-   */
-  @Override public int hashCode() {
-    K k = getKey();
-    V v = getValue();
-    return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode());
-  }
-
-  /**
-   * Returns a string representation of the form <code>{key}={value}</code>.
-   */
-  @Override public String toString() {
-    return getKey() + "=" + getValue();
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/AsynchronousComputationException.java b/core/src/com/google/inject/internal/util/AsynchronousComputationException.java
deleted file mode 100644
index 4b5797a..0000000
--- a/core/src/com/google/inject/internal/util/AsynchronousComputationException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * Wraps an exception that occured during a computation in a different thread.
- *
- * @author Bob Lee
- */
-public class AsynchronousComputationException extends ComputationException {
-
-  public AsynchronousComputationException(Throwable cause) {
-    super(cause);
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Classes.java b/core/src/com/google/inject/internal/util/Classes.java
index 8cb77ad..4891dac 100644
--- a/core/src/com/google/inject/internal/util/Classes.java
+++ b/core/src/com/google/inject/internal/util/Classes.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal.util;
 
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
diff --git a/core/src/com/google/inject/internal/util/Collections2.java b/core/src/com/google/inject/internal/util/Collections2.java
deleted file mode 100644
index b4bca38..0000000
--- a/core/src/com/google/inject/internal/util/Collections2.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Collection;
-import java.util.Set;
-
-/**
- * Provides static methods for working with {@code Collection} instances.
- *
- * @author Chris Povirk
- * @author Mike Bostock
- * @author Jared Levy
- */
-public final class Collections2 {
-  private Collections2() {}
-
-  /**
-   * Converts an iterable into a collection. If the iterable is already a
-   * collection, it is returned. Otherwise, an {@link java.util.ArrayList} is
-   * created with the contents of the iterable in same iteration order.
-   */
-  static <E> Collection<E> toCollection(Iterable<E> iterable) {
-    return (iterable instanceof Collection)
-        ? (Collection<E>) iterable : Lists.newArrayList(iterable);
-  }
-
-  static boolean setEquals(Set<?> thisSet, @Nullable Object object) {
-    if (object == thisSet) {
-      return true;
-    }
-    if (object instanceof Set) {
-      Set<?> thatSet = (Set<?>) object;
-      return thisSet.size() == thatSet.size()
-          && thisSet.containsAll(thatSet);
-    }
-    return false;
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/ComputationException.java b/core/src/com/google/inject/internal/util/ComputationException.java
deleted file mode 100644
index 5205828..0000000
--- a/core/src/com/google/inject/internal/util/ComputationException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * Wraps an exception that occured during a computation.
- */
-public class ComputationException extends RuntimeException {
-
-  public ComputationException(Throwable cause) {
-    super(cause);
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/CustomConcurrentHashMap.java b/core/src/com/google/inject/internal/util/CustomConcurrentHashMap.java
deleted file mode 100644
index 8915d70..0000000
--- a/core/src/com/google/inject/internal/util/CustomConcurrentHashMap.java
+++ /dev/null
@@ -1,2157 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.util.AbstractCollection;
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.atomic.AtomicReferenceArray;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * A framework for concurrent hash map implementations. The
- * CustomConcurrentHashMap class itself is not extensible and does not contain
- * any methods. Use {@link Builder} to create a custom concurrent hash map
- * instance. Client libraries implement {@link Strategy}, and this class
- * provides the surrounding concurrent data structure which implements {@link
- * ConcurrentMap}. Additionally supports implementing maps where {@link
- * Map#get} atomically computes values on demand (see {@link
- * Builder#buildComputingMap(ComputingStrategy, com.google.inject.internal.util.Function)}).
- *
- * <p>The resulting hash table supports full concurrency of retrievals and
- * adjustable expected concurrency for updates. Even though all operations are
- * thread-safe, retrieval operations do <i>not</i> entail locking,
- * and there is <i>not</i> any support for locking the entire table
- * in a way that prevents all access.
- *
- * <p>Retrieval operations (including {@link Map#get}) generally do not
- * block, so may overlap with update operations (including
- * {@link Map#put} and {@link Map#remove}). Retrievals reflect the results
- * of the most recently <i>completed</i> update operations holding
- * upon their onset. For aggregate operations such as {@link Map#putAll}
- * and {@link Map#clear}, concurrent retrievals may reflect insertion or
- * removal of only some entries. Similarly, iterators return elements
- * reflecting the state of the hash table at some point at or since the
- * creation of the iterator. They do <i>not</i> throw
- * {@link java.util.ConcurrentModificationException}. However, iterators can
- * only be used by one thread at a time.
- *
- * <p>The resulting {@link ConcurrentMap} and its views and iterators implement
- * all of the <i>optional</i> methods of the {@link java.util.Map} and {@link
- * java.util.Iterator} interfaces. Partially reclaimed entries are never
- * exposed through the views or iterators.
- *
- * <p>For example, the following strategy emulates the behavior of
- * {@link java.util.concurrent.ConcurrentHashMap}:
- *
- * <pre> {@code
- * class ConcurrentHashMapStrategy<K, V>
- *     implements CustomConcurrentHashMap.Strategy<K, V,
- *     InternalEntry<K, V>>, Serializable {
- *   public InternalEntry<K, V> newEntry(K key, int hash,
- *       InternalEntry<K, V> next) {
- *     return new InternalEntry<K, V>(key, hash, null, next);
- *   }
- *   public InternalEntry<K, V> copyEntry(K key,
- *       InternalEntry<K, V> original, InternalEntry<K, V> next) {
- *     return new InternalEntry<K, V>(key, original.hash, original.value, next);
- *   }
- *   public void setValue(InternalEntry<K, V> entry, V value) {
- *     entry.value = value;
- *   }
- *   public V getValue(InternalEntry<K, V> entry) { return entry.value; }
- *   public boolean equalKeys(K a, Object b) { return a.equals(b); }
- *   public boolean equalValues(V a, Object b) { return a.equals(b); }
- *   public int hashKey(Object key) { return key.hashCode(); }
- *   public K getKey(InternalEntry<K, V> entry) { return entry.key; }
- *   public InternalEntry<K, V> getNext(InternalEntry<K, V> entry) {
- *     return entry.next;
- *   }
- *   public int getHash(InternalEntry<K, V> entry) { return entry.hash; }
- *   public void setInternals(CustomConcurrentHashMap.Internals<K, V,
- *       InternalEntry<K, V>> internals) {} // ignored
- * }
- *
- * class InternalEntry<K, V> {
- *   final K key;
- *   final int hash;
- *   volatile V value;
- *   final InternalEntry<K, V> next;
- *   InternalEntry(K key, int hash, V value, InternalEntry<K, V> next) {
- *     this.key = key;
- *     this.hash = hash;
- *     this.value = value;
- *     this.next = next;
- *   }
- * }
- * }</pre>
- *
- * To create a {@link java.util.concurrent.ConcurrentMap} using the strategy
- * above:
- *
- * <pre>{@code
- *   ConcurrentMap<K, V> map = new CustomConcurrentHashMap.Builder()
- *       .build(new ConcurrentHashMapStrategy<K, V>());
- * }</pre>
- *
- * @author Bob Lee
- * @author Doug Lea
- */
-final class CustomConcurrentHashMap {
-
-  /** Prevents instantiation. */
-  private CustomConcurrentHashMap() {}
-
-  /**
-   * Builds a custom concurrent hash map.
-   */
-  final static class Builder {
-
-    float loadFactor = 0.75f;
-    int initialCapacity = 16;
-    int concurrencyLevel = 16;
-
-    /**
-     * Sets a custom load factor (defaults to 0.75).
-     *
-     * @throws IllegalArgumentException if loadFactor <= 0
-     */
-    public Builder loadFactor(float loadFactor) {
-      if (loadFactor <= 0) {
-        throw new IllegalArgumentException();
-      }
-      this.loadFactor = loadFactor;
-      return this;
-    }
-
-    /**
-     * Sets a custom initial capacity (defaults to 16). Resizing this or any
-     * other kind of hash table is a relatively slow operation, so, when
-     * possible, it is a good idea to provide estimates of expected table
-     * sizes.
-     *
-     * @throws IllegalArgumentException if initialCapacity < 0
-     */
-    public Builder initialCapacity(int initialCapacity) {
-      if (initialCapacity < 0) {
-        throw new IllegalArgumentException();
-      }
-      this.initialCapacity = initialCapacity;
-      return this;
-    }
-
-    /**
-     * Guides the allowed concurrency among update operations. Used as a
-     * hint for internal sizing. The table is internally partitioned to try to
-     * permit the indicated number of concurrent updates without contention.
-     * Because placement in hash tables is essentially random, the actual
-     * concurrency will vary. Ideally, you should choose a value to accommodate
-     * as many threads as will ever concurrently modify the table. Using a
-     * significantly higher value than you need can waste space and time,
-     * and a significantly lower value can lead to thread contention. But
-     * overestimates and underestimates within an order of magnitude do
-     * not usually have much noticeable impact. A value of one is
-     * appropriate when it is known that only one thread will modify and
-     * all others will only read. Defaults to {@literal 16}.
-     *
-     * @throws IllegalArgumentException if concurrencyLevel < 0
-     */
-    public Builder concurrencyLevel(int concurrencyLevel) {
-      if (concurrencyLevel <= 0) {
-        throw new IllegalArgumentException();
-      }
-      this.concurrencyLevel = concurrencyLevel;
-      return this;
-    }
-
-    /**
-     * Creates a new concurrent hash map backed by the given strategy.
-     *
-     * @param strategy used to implement and manipulate the entries
-     *
-     * @param <K> the type of keys to be stored in the returned map
-     * @param <V> the type of values to be stored in the returned map
-     * @param <E> the type of internal entry to be stored in the returned map
-     *
-     * @throws NullPointerException if strategy is null
-     */
-    public <K, V, E> ConcurrentMap<K, V> buildMap(Strategy<K, V, E> strategy) {
-      if (strategy == null) {
-        throw new NullPointerException("strategy");
-      }
-      return new Impl<K, V, E>(strategy, this);
-    }
-
-    /**
-     * Creates a {@link ConcurrentMap}, backed by the given strategy, that
-     * supports atomic, on-demand computation of values. {@link Map#get}
-     * returns the value corresponding to the given key, atomically computes
-     * it using the computer function passed to this builder, or waits for
-     * another thread to compute the value if necessary. Only one value will
-     * be computed for each key at a given time.
-     *
-     * <p>If an entry's value has not finished computing yet, query methods
-     * besides {@link java.util.Map#get} return immediately as if an entry
-     * doesn't exist. In other words, an entry isn't externally visible until
-     * the value's computation completes.
-     *
-     * <p>{@link Map#get} in the returned map implementation throws:
-     * <ul>
-     * <li>{@link NullPointerException} if the key is null or the
-     *  computer returns null</li>
-     * <li>or {@link ComputationException} wrapping an exception thrown by the
-     *  computation</li>
-     * </ul>
-     *
-     * <p><b>Note:</b> Callers of {@code get()} <i>must</i> ensure that the key
-     *  argument is of type {@code K}. {@code Map.get()} takes {@code Object},
-     *  so the key type is not checked at compile time. Passing an object of
-     *  a type other than {@code K} can result in that object being unsafely
-     *  passed to the computer function as type {@code K} not to mention the
-     *  unsafe key being stored in the map.
-     *
-     * @param strategy used to implement and manipulate the entries
-     * @param computer used to compute values for keys
-     *
-     * @param <K> the type of keys to be stored in the returned map
-     * @param <V> the type of values to be stored in the returned map
-     * @param <E> the type of internal entry to be stored in the returned map
-     *
-     * @throws NullPointerException if strategy or computer is null
-     */
-    public <K, V, E> ConcurrentMap<K, V> buildComputingMap(
-        ComputingStrategy<K, V, E> strategy,
-        Function<? super K, ? extends V> computer) {
-      if (strategy == null) {
-        throw new NullPointerException("strategy");
-      }
-      if (computer == null) {
-        throw new NullPointerException("computer");
-      }
-
-      return new ComputingImpl<K, V, E>(strategy, this, computer);
-    }
-  }
-
-  /**
-   * Implements behavior specific to the client's concurrent hash map
-   * implementation. Used by the framework to create new entries and perform
-   * operations on them.
-   *
-   * <p>Method parameters are never null unless otherwise specified.
-   *
-   * <h3>Partially Reclaimed Entries</h3>
-   *
-   * <p>This class does <i>not</i> allow {@code null} to be used as a key.
-   * Setting values to null is not permitted, but entries may have null keys
-   * or values for various reasons. For example, the key or value may have
-   * been garbage collected or reclaimed through other means.
-   * CustomConcurrentHashMap treats entries with null keys and values as
-   * "partially reclaimed" and ignores them for the most part. Entries may
-   * enter a partially reclaimed state but they must not leave it. Partially
-   * reclaimed entries will not be copied over during table expansions, for
-   * example. Strategy implementations should proactively remove partially
-   * reclaimed entries so that {@link Map#isEmpty} and {@link Map#size()}
-   * return up-to-date results.
-   *
-   * @param <K> the type of keys to be stored in the returned map
-   * @param <V> the type of values to be stored in the returned map
-   * @param <E> internal entry type, not directly exposed to clients in map
-   *  views
-   */
-  public interface Strategy<K, V, E> {
-
-    /**
-     * Constructs a new entry for the given key with a pointer to the given
-     * next entry.
-     *
-     * <p>This method may return different entry implementations
-     * depending upon whether next is null or not. For example, if next is
-     * null (as will often be the case), this factory might use an entry
-     * class that doesn't waste memory on an unnecessary field.
-     *
-     * @param key for this entry
-     * @param hash of key returned by {@link #hashKey}
-     * @param next entry (used when implementing a hash bucket as a linked
-     *  list, for example), possibly null
-     * @return a new entry
-     */
-    abstract E newEntry(K key, int hash, E next);
-
-    /**
-     * Creates a copy of the given entry pointing to the given next entry.
-     * Copies the value and any other implementation-specific state from
-     * {@code original} to the returned entry. For example,
-     * CustomConcurrentHashMap might use this method when removing other
-     * entries or expanding the internal table.
-     *
-     * @param key for {@code original} as well as the returned entry.
-     *  Explicitly provided here to prevent reclamation of the key at an
-     *  inopportune time in implementations that don't otherwise keep
-     *  a strong reference to the key.
-     * @param original entry from which the value and other
-     *  implementation-specific state should be copied
-     * @param newNext the next entry the new entry should point to, possibly
-     *  null
-     */
-    E copyEntry(K key, E original, E newNext);
-
-    /**
-     * Sets the value of an entry using volatile semantics. Values are set
-     * synchronously on a per-entry basis.
-     *
-     * @param entry to set the value on
-     * @param value to set
-     */
-    void setValue(E entry, V value);
-
-    /**
-     * Gets the value of an entry using volatile semantics.
-     *
-     * @param entry to get the value from
-     */
-    V getValue(E entry);
-
-    /**
-     * Returns true if the two given keys are equal, false otherwise. Neither
-     * key will be null.
-     *
-     * @param a key from inside the map
-     * @param b key passed from caller, not necesarily of type K
-     *
-     * @see Object#equals the same contractual obligations apply here
-     */
-    boolean equalKeys(K a, Object b);
-
-    /**
-     * Returns true if the two given values are equal, false otherwise. Neither
-     * value will be null.
-     *
-     * @param a value from inside the map
-     * @param b value passed from caller, not necesarily of type V
-     *
-     * @see Object#equals the same contractual obligations apply here
-     */
-    boolean equalValues(V a, Object b);
-
-    /**
-     * Returns a hash code for the given key.
-     *
-     * @see Object#hashCode the same contractual obligations apply here
-     */
-    int hashKey(Object key);
-
-    /**
-     * Gets the key for the given entry. This may return null (for example,
-     * if the key was reclaimed by the garbage collector).
-     *
-     * @param entry to get key from
-     * @return key from the given entry
-     */
-    K getKey(E entry);
-
-    /**
-     * Gets the next entry relative to the given entry, the exact same entry
-     * that was provided to {@link Strategy#newEntry} when the given entry was
-     * created.
-     *
-     * @return the next entry or null if null was passed to
-     *  {@link Strategy#newEntry}
-     */
-    E getNext(E entry);
-
-    /**
-     * Returns the hash code that was passed to {@link Strategy#newEntry})
-     * when the given entry was created.
-     */
-    int getHash(E entry);
-
-// TODO:
-//    /**
-//     * Notifies the strategy that an entry has been removed from the map.
-//     *
-//     * @param entry that was recently removed
-//     */
-//    void remove(E entry);
-
-    /**
-     * Provides an API for interacting directly with the map's internal
-     * entries to this strategy. Invoked once when the map is created.
-     * Strategies that don't need access to the map's internal entries
-     * can simply ignore the argument.
-     *
-     * @param internals of the map, enables direct interaction with the
-     *  internal entries
-     */
-    void setInternals(Internals<K, V, E> internals);
-  }
-
-  /**
-   * Provides access to a map's internal entries.
-   */
-  public interface Internals<K, V, E> {
-
-// TODO:
-//    /**
-//     * Returns a set view of the internal entries.
-//     */
-//    Set<E> entrySet();
-
-    /**
-     * Returns the internal entry corresponding to the given key from the map.
-     *
-     * @param key to retrieve entry for
-     *
-     * @throws NullPointerException if key is null
-     */
-    E getEntry(K key);
-
-    /**
-     * Removes the given entry from the map if the value of the entry in the
-     * map matches the given value.
-     *
-     * @param entry to remove
-     * @param value entry must have for the removal to succeed
-     *
-     * @throws NullPointerException if entry is null
-     */
-    boolean removeEntry(E entry, @Nullable V value);
-
-    /**
-     * Removes the given entry from the map.
-     *
-     * @param entry to remove
-     *
-     * @throws NullPointerException if entry is null
-     */
-    boolean removeEntry(E entry);
-  }
-
-  /**
-   * Extends {@link Strategy} to add support for computing values on-demand.
-   * Implementations should typically intialize the entry's value to a
-   * placeholder value in {@link #newEntry(Object, int, Object)} so that
-   * {@link #waitForValue(Object)} can tell the difference between a
-   * pre-intialized value and an in-progress computation. {@link
-   * #copyEntry(Object, Object, Object)} must detect and handle the case where
-   * an entry is copied in the middle of a computation. Implementations can
-   * throw {@link UnsupportedOperationException} in {@link #setValue(Object,
-   * Object)} if they wish to prevent users from setting values directly.
-   *
-   * @see Builder#buildComputingMap(ComputingStrategy, Function)
-   */
-  public interface ComputingStrategy<K, V, E> extends Strategy<K, V, E> {
-
-    /**
-     * Computes a value for the given key and stores it in the given entry.
-     * Called as a result of {@link Map#get}. If this method throws an
-     * exception, CustomConcurrentHashMap will remove the entry and retry
-     * the computation on subsequent requests.
-     *
-     * @param entry that was created
-     * @param computer passed to {@link Builder#buildMap}
-     *
-     * @throws ComputationException if the computation threw an exception
-     * @throws NullPointerException if the computer returned null
-     *
-     * @return the computed value
-     */
-    V compute(K key, E entry, Function<? super K, ? extends V> computer);
-
-    /**
-     * Gets a value from an entry waiting for the value to be set by {@link
-     * #compute} if necessary. Returns null if a value isn't available at
-     * which point CustomConcurrentHashMap tries to compute a new value.
-     *
-     * @param entry to return value from
-     * @return stored value or null if the value isn't available
-     *
-     * @throws InterruptedException if the thread was interrupted while
-     *  waiting
-     */
-    V waitForValue(E entry) throws InterruptedException;
-  }
-
-  /**
-   * Applies a supplemental hash function to a given hash code, which defends
-   * against poor quality hash functions. This is critical when the
-   * concurrent hash map uses power-of-two length hash tables, that otherwise
-   * encounter collisions for hash codes that do not differ in lower or upper
-   * bits.
-   *
-   * @param h hash code
-   */
-  private static int rehash(int h) {
-    // Spread bits to regularize both segment and index locations,
-    // using variant of single-word Wang/Jenkins hash.
-    h += (h << 15) ^ 0xffffcd7d;
-    h ^= (h >>> 10);
-    h += (h << 3);
-    h ^= (h >>> 6);
-    h += (h << 2) + (h << 14);
-    return h ^ (h >>> 16);
-  }
-
-  /** The concurrent hash map implementation. */
-  static class Impl<K, V, E> extends AbstractMap<K, V>
-      implements ConcurrentMap<K, V>, Serializable {
-
-    /*
-     * The basic strategy is to subdivide the table among Segments,
-     * each of which itself is a concurrently readable hash table.
-     */
-
-    /* ---------------- Constants -------------- */
-
-    /**
-     * The maximum capacity, used if a higher value is implicitly specified by
-     * either of the constructors with arguments.  MUST be a power of two <=
-     * 1<<30 to ensure that entries are indexable using ints.
-     */
-    static final int MAXIMUM_CAPACITY = 1 << 30;
-
-    /**
-     * The maximum number of segments to allow; used to bound constructor
-     * arguments.
-     */
-    static final int MAX_SEGMENTS = 1 << 16; // slightly conservative
-
-    /**
-     * Number of unsynchronized retries in size and containsValue methods before
-     * resorting to locking. This is used to avoid unbounded retries if tables
-     * undergo continuous modification which would make it impossible to obtain
-     * an accurate result.
-     */
-    static final int RETRIES_BEFORE_LOCK = 2;
-
-    /* ---------------- Fields -------------- */
-
-    /**
-     * The strategy used to implement this map.
-     */
-    final Strategy<K, V, E> strategy;
-
-    /**
-     * Mask value for indexing into segments. The upper bits of a key's hash
-     * code are used to choose the segment.
-     */
-    final int segmentMask;
-
-    /**
-     * Shift value for indexing within segments. Helps prevent entries that
-     * end up in the same segment from also ending up in the same bucket.
-     */
-    final int segmentShift;
-
-    /**
-     * The segments, each of which is a specialized hash table
-     */
-    final Segment[] segments;
-
-    /**
-     * The load factor for the hash table.
-     */
-    final float loadFactor;
-
-    /**
-     * Creates a new, empty map with the specified strategy, initial capacity,
-     * load factor and concurrency level.
-     */
-    Impl(Strategy<K, V, E> strategy, Builder builder) {
-      this.loadFactor = builder.loadFactor;
-      int concurrencyLevel = builder.concurrencyLevel;
-      int initialCapacity = builder.initialCapacity;
-
-      if (concurrencyLevel > MAX_SEGMENTS) {
-        concurrencyLevel = MAX_SEGMENTS;
-      }
-
-      // Find power-of-two sizes best matching arguments
-      int segmentShift = 0;
-      int segmentCount = 1;
-      while (segmentCount < concurrencyLevel) {
-        ++segmentShift;
-        segmentCount <<= 1;
-      }
-      this.segmentShift = 32 - segmentShift;
-      segmentMask = segmentCount - 1;
-      this.segments = newSegmentArray(segmentCount);
-
-      if (initialCapacity > MAXIMUM_CAPACITY) {
-        initialCapacity = MAXIMUM_CAPACITY;
-      }
-
-      int segmentCapacity = initialCapacity / segmentCount;
-      if (segmentCapacity * segmentCount < initialCapacity) {
-        ++segmentCapacity;
-      }
-
-      int segmentSize = 1;
-      while (segmentSize < segmentCapacity) {
-          segmentSize <<= 1;
-      }
-      for (int i = 0; i < this.segments.length; ++i) {
-        this.segments[i] = new Segment(segmentSize);
-      }
-
-      this.strategy = strategy;
-
-      strategy.setInternals(new InternalsImpl());
-    }
-
-    int hash(Object key) {
-      int h = strategy.hashKey(key);
-      return rehash(h);
-    }
-
-    class InternalsImpl implements Internals<K, V, E>, Serializable {
-
-      static final long serialVersionUID = 0;
-
-      public E getEntry(K key) {
-        if (key == null) {
-          throw new NullPointerException("key");
-        }
-        int hash = hash(key);
-        return segmentFor(hash).getEntry(key, hash);
-      }
-
-      public boolean removeEntry(E entry, V value) {
-        if (entry == null) {
-          throw new NullPointerException("entry");
-        }
-        int hash = strategy.getHash(entry);
-        return segmentFor(hash).removeEntry(entry, hash, value);
-      }
-
-      public boolean removeEntry(E entry) {
-        if (entry == null) {
-          throw new NullPointerException("entry");
-        }
-        int hash = strategy.getHash(entry);
-        return segmentFor(hash).removeEntry(entry, hash);
-      }
-    }
-
-    @SuppressWarnings("unchecked")
-    Segment[] newSegmentArray(int ssize) {
-      // Note: This is the only way I could figure out how to create
-      // a segment array (the compile has a tough time with arrays of
-      // inner classes of generic types apparently). Safe because we're
-      // restricting what can go in the array and no one has an
-      // unrestricted reference.
-      return (Segment[]) Array.newInstance(Segment.class, ssize);
-    }
-
-    /* ---------------- Small Utilities -------------- */
-
-    /**
-     * Returns the segment that should be used for key with given hash
-     *
-     * @param hash the hash code for the key
-     * @return the segment
-     */
-    Segment segmentFor(int hash) {
-      return segments[(hash >>> segmentShift) & segmentMask];
-    }
-
-    /* ---------------- Inner Classes -------------- */
-
-    /**
-     * Segments are specialized versions of hash tables.  This subclasses from
-     * ReentrantLock opportunistically, just to simplify some locking and avoid
-     * separate construction.
-     */
-    @SuppressWarnings("serial") // This class is never serialized.
-    final class Segment extends ReentrantLock {
-
-      /*
-       * Segments maintain a table of entry lists that are ALWAYS
-       * kept in a consistent state, so can be read without locking.
-       * Next fields of nodes are immutable (final).  All list
-       * additions are performed at the front of each bin. This
-       * makes it easy to check changes, and also fast to traverse.
-       * When nodes would otherwise be changed, new nodes are
-       * created to replace them. This works well for hash tables
-       * since the bin lists tend to be short. (The average length
-       * is less than two for the default load factor threshold.)
-       *
-       * Read operations can thus proceed without locking, but rely
-       * on selected uses of volatiles to ensure that completed
-       * write operations performed by other threads are
-       * noticed. For most purposes, the "count" field, tracking the
-       * number of elements, serves as that volatile variable
-       * ensuring visibility.  This is convenient because this field
-       * needs to be read in many read operations anyway:
-       *
-       *   - All (unsynchronized) read operations must first read the
-       *     "count" field, and should not look at table entries if
-       *     it is 0.
-       *
-       *   - All (synchronized) write operations should write to
-       *     the "count" field after structurally changing any bin.
-       *     The operations must not take any action that could even
-       *     momentarily cause a concurrent read operation to see
-       *     inconsistent data. This is made easier by the nature of
-       *     the read operations in Map. For example, no operation
-       *     can reveal that the table has grown but the threshold
-       *     has not yet been updated, so there are no atomicity
-       *     requirements for this with respect to reads.
-       *
-       * As a guide, all critical volatile reads and writes to the
-       * count field are marked in code comments.
-       */
-
-      /**
-       * The number of elements in this segment's region.
-       */
-      volatile int count;
-
-      /**
-       * Number of updates that alter the size of the table. This is used
-       * during bulk-read methods to make sure they see a consistent snapshot:
-       * If modCounts change during a traversal of segments computing size or
-       * checking containsValue, then we might have an inconsistent view of
-       * state so (usually) must retry.
-       */
-      int modCount;
-
-      /**
-       * The table is expanded when its size exceeds this threshold. (The
-       * value of this field is always {@code (int)(capacity * loadFactor)}.)
-       */
-      int threshold;
-
-      /**
-       * The per-segment table.
-       */
-      volatile AtomicReferenceArray<E> table;
-
-      Segment(int initialCapacity) {
-        setTable(newEntryArray(initialCapacity));
-      }
-
-      AtomicReferenceArray<E> newEntryArray(int size) {
-        return new AtomicReferenceArray<E>(size);
-      }
-
-      /**
-       * Sets table to new HashEntry array. Call only while holding lock or in
-       * constructor.
-       */
-      void setTable(AtomicReferenceArray<E> newTable) {
-        this.threshold = (int) (newTable.length() * loadFactor);
-        this.table = newTable;
-      }
-
-      /**
-       * Returns properly casted first entry of bin for given hash.
-       */
-      E getFirst(int hash) {
-        AtomicReferenceArray<E> table = this.table;
-        return table.get(hash & (table.length() - 1));
-      }
-
-      /* Specialized implementations of map methods */
-
-      public E getEntry(Object key, int hash) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        if (count != 0) { // read-volatile
-          for (E e = getFirst(hash); e != null; e = s.getNext(e)) {
-            if (s.getHash(e) != hash) {
-              continue;
-            }
-
-            K entryKey = s.getKey(e);
-            if (entryKey == null) {
-              continue;
-            }
-
-            if (s.equalKeys(entryKey, key)) {
-              return e;
-            }
-          }
-        }
-
-        return null;
-      }
-
-      V get(Object key, int hash) {
-        E entry = getEntry(key, hash);
-        if (entry == null) {
-          return null;
-        }
-
-        return strategy.getValue(entry);
-      }
-
-      boolean containsKey(Object key, int hash) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        if (count != 0) { // read-volatile
-          for (E e = getFirst(hash); e != null; e = s.getNext(e)) {
-            if (s.getHash(e) != hash) {
-              continue;
-            }
-
-            K entryKey = s.getKey(e);
-            if (entryKey == null) {
-              continue;
-            }
-
-            if (s.equalKeys(entryKey, key)) {
-              // Return true only if this entry has a value.
-              return s.getValue(e) != null;
-            }
-          }
-        }
-
-        return false;
-      }
-
-      boolean containsValue(Object value) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        if (count != 0) { // read-volatile
-          AtomicReferenceArray<E> table = this.table;
-          int length = table.length();
-          for (int i = 0; i < length; i++) {
-            for (E e = table.get(i); e != null; e = s.getNext(e)) {
-              V entryValue = s.getValue(e);
-
-              // If the value disappeared, this entry is partially collected,
-              // and we should skip it.
-              if (entryValue == null) {
-                continue;
-              }
-
-              if (s.equalValues(entryValue, value)) {
-                return true;
-              }
-            }
-          }
-        }
-
-        return false;
-      }
-
-      boolean replace(K key, int hash, V oldValue, V newValue) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          for (E e = getFirst(hash); e != null; e = s.getNext(e)) {
-            K entryKey = s.getKey(e);
-            if (s.getHash(e) == hash && entryKey != null
-                && s.equalKeys(key, entryKey)) {
-              // If the value disappeared, this entry is partially collected,
-              // and we should pretend like it doesn't exist.
-              V entryValue = s.getValue(e);
-              if (entryValue == null) {
-                return false;
-              }
-
-              if (s.equalValues(entryValue, oldValue)) {
-                s.setValue(e, newValue);
-                return true;
-              }
-            }
-          }
-
-          return false;
-        } finally {
-          unlock();
-        }
-      }
-
-      V replace(K key, int hash, V newValue) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          for (E e = getFirst(hash); e != null; e = s.getNext(e)) {
-            K entryKey = s.getKey(e);
-            if (s.getHash(e) == hash && entryKey != null
-                && s.equalKeys(key, entryKey)) {
-              // If the value disappeared, this entry is partially collected,
-              // and we should pretend like it doesn't exist.
-              V entryValue = s.getValue(e);
-              if (entryValue == null) {
-                return null;
-              }
-
-              s.setValue(e, newValue);
-              return entryValue;
-            }
-          }
-
-          return null;
-        } finally {
-          unlock();
-        }
-      }
-
-      V put(K key, int hash, V value, boolean onlyIfAbsent) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          int count = this.count;
-          if (count++ > this.threshold) { // ensure capacity
-            expand();
-          }
-
-          AtomicReferenceArray<E> table = this.table;
-          int index = hash & (table.length() - 1);
-
-          E first = table.get(index);
-
-          // Look for an existing entry.
-          for (E e = first; e != null; e = s.getNext(e)) {
-            K entryKey = s.getKey(e);
-            if (s.getHash(e) == hash && entryKey != null
-                && s.equalKeys(key, entryKey)) {
-              // We found an existing entry.
-
-              // If the value disappeared, this entry is partially collected,
-              // and we should pretend like it doesn't exist.
-              V entryValue = s.getValue(e);
-              if (onlyIfAbsent && entryValue != null) {
-                return entryValue;
-              }
-
-              s.setValue(e, value);
-              return entryValue;
-            }
-          }
-
-          // Create a new entry.
-          ++modCount;
-          E newEntry = s.newEntry(key, hash, first);
-          s.setValue(newEntry, value);
-          table.set(index, newEntry);
-          this.count = count; // write-volatile
-          return null;
-        } finally {
-          unlock();
-        }
-      }
-
-      /**
-       * Expands the table if possible.
-       */
-      void expand() {
-        AtomicReferenceArray<E> oldTable = table;
-        int oldCapacity = oldTable.length();
-        if (oldCapacity >= MAXIMUM_CAPACITY) {
-          return;
-        }
-
-        /*
-         * Reclassify nodes in each list to new Map.  Because we are
-         * using power-of-two expansion, the elements from each bin
-         * must either stay at same index, or move with a power of two
-         * offset. We eliminate unnecessary node creation by catching
-         * cases where old nodes can be reused because their next
-         * fields won't change. Statistically, at the default
-         * threshold, only about one-sixth of them need cloning when
-         * a table doubles. The nodes they replace will be garbage
-         * collectable as soon as they are no longer referenced by any
-         * reader thread that may be in the midst of traversing table
-         * right now.
-         */
-
-        Strategy<K, V, E> s = Impl.this.strategy;
-        AtomicReferenceArray<E> newTable = newEntryArray(oldCapacity << 1);
-        threshold = (int) (newTable.length() * loadFactor);
-        int newMask = newTable.length() - 1;
-        for (int oldIndex = 0; oldIndex < oldCapacity; oldIndex++) {
-          // We need to guarantee that any existing reads of old Map can
-          //  proceed. So we cannot yet null out each bin.
-          E head = oldTable.get(oldIndex);
-
-          if (head != null) {
-            E next = s.getNext(head);
-            int headIndex = s.getHash(head) & newMask;
-
-            // Single node on list
-            if (next == null) {
-              newTable.set(headIndex, head);
-            } else {
-              // Reuse the consecutive sequence of nodes with the same target
-              // index from the end of the list. tail points to the first
-              // entry in the reusable list.
-              E tail = head;
-              int tailIndex = headIndex;
-              for (E last = next; last != null; last = s.getNext(last)) {
-                int newIndex = s.getHash(last) & newMask;
-                if (newIndex != tailIndex) {
-                  // The index changed. We'll need to copy the previous entry.
-                  tailIndex = newIndex;
-                  tail = last;
-                }
-              }
-              newTable.set(tailIndex, tail);
-
-              // Clone nodes leading up to the tail.
-              for (E e = head; e != tail; e = s.getNext(e)) {
-                K key = s.getKey(e);
-                if (key != null) {
-                  int newIndex = s.getHash(e) & newMask;
-                  E newNext = newTable.get(newIndex);
-                  newTable.set(newIndex, s.copyEntry(key, e, newNext));
-                } else {
-                  // Key was reclaimed. Skip entry.
-                }
-              }
-            }
-          }
-        }
-        table = newTable;
-      }
-
-      V remove(Object key, int hash) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          int count = this.count - 1;
-          AtomicReferenceArray<E> table = this.table;
-          int index = hash & (table.length() - 1);
-          E first = table.get(index);
-
-          for (E e = first; e != null; e = s.getNext(e)) {
-            K entryKey = s.getKey(e);
-            if (s.getHash(e) == hash && entryKey != null
-                && s.equalKeys(entryKey, key)) {
-              V entryValue = strategy.getValue(e);
-              // All entries following removed node can stay
-              // in list, but all preceding ones need to be
-              // cloned.
-              ++modCount;
-              E newFirst = s.getNext(e);
-              for (E p = first; p != e; p = s.getNext(p)) {
-                K pKey = s.getKey(p);
-                if (pKey != null) {
-                  newFirst = s.copyEntry(pKey, p, newFirst);
-                } else {
-                  // Key was reclaimed. Skip entry.
-                }
-              }
-              table.set(index, newFirst);
-              this.count = count; // write-volatile
-              return entryValue;
-            }
-          }
-
-          return null;
-        } finally {
-          unlock();
-        }
-      }
-
-      boolean remove(Object key, int hash, Object value) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          int count = this.count - 1;
-          AtomicReferenceArray<E> table = this.table;
-          int index = hash & (table.length() - 1);
-          E first = table.get(index);
-
-          for (E e = first; e != null; e = s.getNext(e)) {
-            K entryKey = s.getKey(e);
-            if (s.getHash(e) == hash && entryKey != null
-                && s.equalKeys(entryKey, key)) {
-              V entryValue = strategy.getValue(e);
-              if (value == entryValue || (value != null && entryValue != null
-                  && s.equalValues(entryValue, value))) {
-                // All entries following removed node can stay
-                // in list, but all preceding ones need to be
-                // cloned.
-                ++modCount;
-                E newFirst = s.getNext(e);
-                for (E p = first; p != e; p = s.getNext(p)) {
-                  K pKey = s.getKey(p);
-                  if (pKey != null) {
-                    newFirst = s.copyEntry(pKey, p, newFirst);
-                  } else {
-                    // Key was reclaimed. Skip entry.
-                  }
-                }
-                table.set(index, newFirst);
-                this.count = count; // write-volatile
-                return true;
-              } else {
-                return false;
-              }
-            }
-          }
-
-          return false;
-        } finally {
-          unlock();
-        }
-      }
-
-      public boolean removeEntry(E entry, int hash, V value) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          int count = this.count - 1;
-          AtomicReferenceArray<E> table = this.table;
-          int index = hash & (table.length() - 1);
-          E first = table.get(index);
-
-          for (E e = first; e != null; e = s.getNext(e)) {
-            if (s.getHash(e) == hash && entry.equals(e)) {
-              V entryValue = s.getValue(e);
-              if (entryValue == value || (value != null
-                  && s.equalValues(entryValue, value))) {
-                // All entries following removed node can stay
-                // in list, but all preceding ones need to be
-                // cloned.
-                ++modCount;
-                E newFirst = s.getNext(e);
-                for (E p = first; p != e; p = s.getNext(p)) {
-                  K pKey = s.getKey(p);
-                  if (pKey != null) {
-                    newFirst = s.copyEntry(pKey, p, newFirst);
-                  } else {
-                    // Key was reclaimed. Skip entry.
-                  }
-                }
-                table.set(index, newFirst);
-                this.count = count; // write-volatile
-                return true;
-              } else {
-                return false;
-              }
-            }
-          }
-
-          return false;
-        } finally {
-          unlock();
-        }
-      }
-
-      public boolean removeEntry(E entry, int hash) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        lock();
-        try {
-          int count = this.count - 1;
-          AtomicReferenceArray<E> table = this.table;
-          int index = hash & (table.length() - 1);
-          E first = table.get(index);
-
-          for (E e = first; e != null; e = s.getNext(e)) {
-            if (s.getHash(e) == hash && entry.equals(e)) {
-              // All entries following removed node can stay
-              // in list, but all preceding ones need to be
-              // cloned.
-              ++modCount;
-              E newFirst = s.getNext(e);
-              for (E p = first; p != e; p = s.getNext(p)) {
-                K pKey = s.getKey(p);
-                if (pKey != null) {
-                  newFirst = s.copyEntry(pKey, p, newFirst);
-                } else {
-                  // Key was reclaimed. Skip entry.
-                }
-              }
-              table.set(index, newFirst);
-              this.count = count; // write-volatile
-              return true;
-            }
-          }
-
-          return false;
-        } finally {
-          unlock();
-        }
-      }
-
-      void clear() {
-        if (count != 0) {
-          lock();
-          try {
-            AtomicReferenceArray<E> table = this.table;
-            for (int i = 0; i < table.length(); i++) {
-              table.set(i, null);
-            }
-            ++modCount;
-            count = 0; // write-volatile
-          } finally {
-            unlock();
-          }
-        }
-      }
-    }
-
-    /* ---------------- Public operations -------------- */
-
-    /**
-     * Returns {@code true} if this map contains no key-value mappings.
-     *
-     * @return {@code true} if this map contains no key-value mappings
-     */
-    @Override public boolean isEmpty() {
-      final Segment[] segments = this.segments;
-      /*
-       * We keep track of per-segment modCounts to avoid ABA
-       * problems in which an element in one segment was added and
-       * in another removed during traversal, in which case the
-       * table was never actually empty at any point. Note the
-       * similar use of modCounts in the size() and containsValue()
-       * methods, which are the only other methods also susceptible
-       * to ABA problems.
-       */
-      int[] mc = new int[segments.length];
-      int mcsum = 0;
-      for (int i = 0; i < segments.length; ++i) {
-        if (segments[i].count != 0) {
-          return false;
-        } else {
-          mcsum += mc[i] = segments[i].modCount;
-        }
-      }
-      // If mcsum happens to be zero, then we know we got a snapshot
-      // before any modifications at all were made.  This is
-      // probably common enough to bother tracking.
-      if (mcsum != 0) {
-        for (int i = 0; i < segments.length; ++i) {
-          if (segments[i].count != 0 ||
-              mc[i] != segments[i].modCount) {
-            return false;
-          }
-        }
-      }
-      return true;
-    }
-
-    /**
-     * Returns the number of key-value mappings in this map.  If the map
-     * contains more than {@code Integer.MAX_VALUE} elements, returns
-     * {@code Integer.MAX_VALUE}.
-     *
-     * @return the number of key-value mappings in this map
-     */
-    @Override public int size() {
-      final Segment[] segments = this.segments;
-      long sum = 0;
-      long check = 0;
-      int[] mc = new int[segments.length];
-      // Try a few times to get accurate count. On failure due to
-      // continuous async changes in table, resort to locking.
-      for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
-        check = 0;
-        sum = 0;
-        int mcsum = 0;
-        for (int i = 0; i < segments.length; ++i) {
-          sum += segments[i].count;
-          mcsum += mc[i] = segments[i].modCount;
-        }
-        if (mcsum != 0) {
-          for (int i = 0; i < segments.length; ++i) {
-            check += segments[i].count;
-            if (mc[i] != segments[i].modCount) {
-              check = -1; // force retry
-              break;
-            }
-          }
-        }
-        if (check == sum) {
-          break;
-        }
-      }
-      if (check != sum) { // Resort to locking all segments
-        sum = 0;
-        for (Segment segment : segments) {
-          segment.lock();
-        }
-        for (Segment segment : segments) {
-          sum += segment.count;
-        }
-        for (Segment segment : segments) {
-          segment.unlock();
-        }
-      }
-      if (sum > Integer.MAX_VALUE) {
-        return Integer.MAX_VALUE;
-      } else {
-        return (int) sum;
-      }
-    }
-
-    /**
-     * Returns the value to which the specified key is mapped, or {@code null}
-     * if this map contains no mapping for the key.
-     *
-     * <p>More formally, if this map contains a mapping from a key {@code k} to
-     * a value {@code v} such that {@code key.equals(k)}, then this method
-     * returns {@code v}; otherwise it returns {@code null}.  (There can be at
-     * most one such mapping.)
-     *
-     * @throws NullPointerException if the specified key is null
-     */
-    @Override public V get(Object key) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).get(key, hash);
-    }
-
-    /**
-     * Tests if the specified object is a key in this table.
-     *
-     * @param key possible key
-     * @return {@code true} if and only if the specified object is a key in
-     *         this table, as determined by the {@code equals} method;
-     *         {@code false} otherwise.
-     * @throws NullPointerException if the specified key is null
-     */
-    @Override public boolean containsKey(Object key) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).containsKey(key, hash);
-    }
-
-    /**
-     * Returns {@code true} if this map maps one or more keys to the specified
-     * value. Note: This method requires a full internal traversal of the hash
-     * table, and so is much slower than method {@code containsKey}.
-     *
-     * @param value value whose presence in this map is to be tested
-     * @return {@code true} if this map maps one or more keys to the specified
-     *         value
-     * @throws NullPointerException if the specified value is null
-     */
-    @Override public boolean containsValue(Object value) {
-      if (value == null) {
-        throw new NullPointerException("value");
-      }
-
-      // See explanation of modCount use above
-
-      final Segment[] segments = this.segments;
-      int[] mc = new int[segments.length];
-
-      // Try a few times without locking
-      for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
-        int mcsum = 0;
-        for (int i = 0; i < segments.length; ++i) {
-          @SuppressWarnings("UnusedDeclaration")
-          int c = segments[i].count;
-          mcsum += mc[i] = segments[i].modCount;
-          if (segments[i].containsValue(value)) {
-            return true;
-          }
-        }
-        boolean cleanSweep = true;
-        if (mcsum != 0) {
-          for (int i = 0; i < segments.length; ++i) {
-            @SuppressWarnings("UnusedDeclaration")
-            int c = segments[i].count;
-            if (mc[i] != segments[i].modCount) {
-              cleanSweep = false;
-              break;
-            }
-          }
-        }
-        if (cleanSweep) {
-          return false;
-        }
-      }
-      // Resort to locking all segments
-      for (Segment segment : segments) {
-        segment.lock();
-      }
-      boolean found = false;
-      try {
-        for (Segment segment : segments) {
-          if (segment.containsValue(value)) {
-            found = true;
-            break;
-          }
-        }
-      } finally {
-        for (Segment segment : segments) {
-          segment.unlock();
-        }
-      }
-      return found;
-    }
-
-    /**
-     * Maps the specified key to the specified value in this table. Neither the
-     * key nor the value can be null.
-     *
-     * <p> The value can be retrieved by calling the {@code get} method with a
-     * key that is equal to the original key.
-     *
-     * @param key   key with which the specified value is to be associated
-     * @param value value to be associated with the specified key
-     * @return the previous value associated with {@code key}, or {@code null}
-     *         if there was no mapping for {@code key}
-     * @throws NullPointerException if the specified key or value is null
-     */
-    @Override public V put(K key, V value) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      if (value == null) {
-        throw new NullPointerException("value");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).put(key, hash, value, false);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return the previous value associated with the specified key, or
-     *         {@code null} if there was no mapping for the key
-     * @throws NullPointerException if the specified key or value is null
-     */
-    public V putIfAbsent(K key, V value) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      if (value == null) {
-        throw new NullPointerException("value");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).put(key, hash, value, true);
-    }
-
-    /**
-     * Copies all of the mappings from the specified map to this one. These
-     * mappings replace any mappings that this map had for any of the keys
-     * currently in the specified map.
-     *
-     * @param m mappings to be stored in this map
-     */
-    @Override public void putAll(Map<? extends K, ? extends V> m) {
-      for (Entry<? extends K, ? extends V> e : m.entrySet()) {
-        put(e.getKey(), e.getValue());
-      }
-    }
-
-    /**
-     * Removes the key (and its corresponding value) from this map. This method
-     * does nothing if the key is not in the map.
-     *
-     * @param key the key that needs to be removed
-     * @return the previous value associated with {@code key}, or {@code null}
-     *         if there was no mapping for {@code key}
-     * @throws NullPointerException if the specified key is null
-     */
-    @Override public V remove(Object key) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).remove(key, hash);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @throws NullPointerException if the specified key is null
-     */
-    public boolean remove(Object key, Object value) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).remove(key, hash, value);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @throws NullPointerException if any of the arguments are null
-     */
-    public boolean replace(K key, V oldValue, V newValue) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      if (oldValue == null) {
-        throw new NullPointerException("oldValue");
-      }
-      if (newValue == null) {
-        throw new NullPointerException("newValue");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).replace(key, hash, oldValue, newValue);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return the previous value associated with the specified key, or
-     *         {@code null} if there was no mapping for the key
-     * @throws NullPointerException if the specified key or value is null
-     */
-    public V replace(K key, V value) {
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-      if (value == null) {
-        throw new NullPointerException("value");
-      }
-      int hash = hash(key);
-      return segmentFor(hash).replace(key, hash, value);
-    }
-
-    /**
-     * Removes all of the mappings from this map.
-     */
-    @Override public void clear() {
-      for (Segment segment : segments) {
-        segment.clear();
-      }
-    }
-
-    Set<K> keySet;
-
-    /**
-     * Returns a {@link java.util.Set} view of the keys contained in this map.
-     * The set is backed by the map, so changes to the map are reflected in the
-     * set, and vice-versa. The set supports element removal, which removes the
-     * corresponding mapping from this map, via the {@code Iterator.remove},
-     * {@code Set.remove}, {@code removeAll}, {@code retainAll}, and
-     * {@code clear} operations. It does not support the {@code add} or
-     * {@code addAll} operations.
-     *
-     * <p>The view's {@code iterator} is a "weakly consistent" iterator that
-     * will never throw {@link java.util.ConcurrentModificationException}, and
-     * guarantees to traverse elements as they existed upon construction of the
-     * iterator, and may (but is not guaranteed to) reflect any modifications
-     * subsequent to construction.
-     */
-    @Override public Set<K> keySet() {
-      Set<K> ks = keySet;
-      return (ks != null) ? ks : (keySet = new KeySet());
-    }
-
-    Collection<V> values;
-
-    /**
-     * Returns a {@link java.util.Collection} view of the values contained in
-     * this map. The collection is backed by the map, so changes to the map are
-     * reflected in the collection, and vice-versa. The collection supports
-     * element removal, which removes the corresponding mapping from this map,
-     * via the {@code Iterator.remove}, {@code Collection.remove},
-     * {@code removeAll}, {@code retainAll}, and {@code clear} operations. It
-     * does not support the {@code add} or {@code addAll} operations.
-     *
-     * <p>The view's {@code iterator} is a "weakly consistent" iterator that
-     * will never throw {@link java.util.ConcurrentModificationException}, and
-     * guarantees to traverse elements as they existed upon construction of the
-     * iterator, and may (but is not guaranteed to) reflect any modifications
-     * subsequent to construction.
-     */
-    @Override public Collection<V> values() {
-      Collection<V> vs = values;
-      return (vs != null) ? vs : (values = new Values());
-    }
-
-    Set<Entry<K, V>> entrySet;
-
-    /**
-     * Returns a {@link java.util.Set} view of the mappings contained in this
-     * map. The set is backed by the map, so changes to the map are reflected in
-     * the set, and vice-versa. The set supports element removal, which removes
-     * the corresponding mapping from the map, via the {@code Iterator.remove},
-     * {@code Set.remove}, {@code removeAll}, {@code retainAll}, and
-     * {@code clear} operations. It does not support the {@code add} or
-     * {@code addAll} operations.
-     *
-     * <p>The view's {@code iterator} is a "weakly consistent" iterator that
-     * will never throw {@link java.util.ConcurrentModificationException}, and
-     * guarantees to traverse elements as they existed upon construction of the
-     * iterator, and may (but is not guaranteed to) reflect any modifications
-     * subsequent to construction.
-     */
-    public Set<Entry<K, V>> entrySet() {
-      Set<Entry<K, V>> es = entrySet;
-      return (es != null) ? es : (entrySet = new EntrySet());
-    }
-
-    /* ---------------- Iterator Support -------------- */
-
-    abstract class HashIterator {
-
-      int nextSegmentIndex;
-      int nextTableIndex;
-      AtomicReferenceArray<E> currentTable;
-      E nextEntry;
-      WriteThroughEntry nextExternal;
-      WriteThroughEntry lastReturned;
-
-      HashIterator() {
-        nextSegmentIndex = segments.length - 1;
-        nextTableIndex = -1;
-        advance();
-      }
-
-      public boolean hasMoreElements() {
-        return hasNext();
-      }
-
-      final void advance() {
-        nextExternal = null;
-
-        if (nextInChain()) {
-          return;
-        }
-
-        if (nextInTable()) {
-          return;
-        }
-
-        while (nextSegmentIndex >= 0) {
-          Segment seg = segments[nextSegmentIndex--];
-          if (seg.count != 0) {
-            currentTable = seg.table;
-            nextTableIndex = currentTable.length() - 1;
-            if (nextInTable()) {
-              return;
-            }
-          }
-        }
-      }
-
-      /**
-       * Finds the next entry in the current chain. Returns true if an entry
-       * was found.
-       */
-      boolean nextInChain() {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        if (nextEntry != null) {
-          for (nextEntry = s.getNext(nextEntry); nextEntry != null;
-              nextEntry = s.getNext(nextEntry)) {
-            if (advanceTo(nextEntry)) {
-              return true;
-            }
-          }
-        }
-        return false;
-      }
-
-      /**
-       * Finds the next entry in the current table. Returns true if an entry
-       * was found.
-       */
-      boolean nextInTable() {
-        while (nextTableIndex >= 0) {
-          if ((nextEntry = currentTable.get(nextTableIndex--)) != null) {
-            if (advanceTo(nextEntry) || nextInChain()) {
-              return true;
-            }
-          }
-        }
-        return false;
-      }
-
-      /**
-       * Advances to the given entry. Returns true if the entry was valid,
-       * false if it should be skipped.
-       */
-      boolean advanceTo(E entry) {
-        Strategy<K, V, E> s = Impl.this.strategy;
-        K key = s.getKey(entry);
-        V value = s.getValue(entry);
-        if (key != null && value != null) {
-          nextExternal = new WriteThroughEntry(key, value);
-          return true;
-        } else {
-          // Skip partially reclaimed entry.
-          return false;
-        }
-      }
-
-      public boolean hasNext() {
-        return nextExternal != null;
-      }
-
-      WriteThroughEntry nextEntry() {
-        if (nextExternal == null) {
-          throw new NoSuchElementException();
-        }
-        lastReturned = nextExternal;
-        advance();
-        return lastReturned;
-      }
-
-      public void remove() {
-        if (lastReturned == null) {
-          throw new IllegalStateException();
-        }
-        Impl.this.remove(lastReturned.getKey());
-        lastReturned = null;
-      }
-    }
-
-    final class KeyIterator extends HashIterator implements Iterator<K> {
-
-      public K next() {
-        return super.nextEntry().getKey();
-      }
-    }
-
-    final class ValueIterator extends HashIterator implements Iterator<V> {
-
-      public V next() {
-        return super.nextEntry().getValue();
-      }
-    }
-
-    /**
-     * Custom Entry class used by EntryIterator.next(), that relays setValue
-     * changes to the underlying map.
-     */
-    final class WriteThroughEntry extends AbstractMapEntry<K, V> {
-      final K key;
-      V value;
-
-      WriteThroughEntry(K key, V value) {
-        this.key = key;
-        this.value = value;
-      }
-
-      public K getKey() {
-        return key;
-      }
-
-      public V getValue() {
-        return value;
-      }
-
-      /**
-       * Set our entry's value and write through to the map. The value to
-       * return is somewhat arbitrary here. Since a WriteThroughEntry does not
-       * necessarily track asynchronous changes, the most recent "previous"
-       * value could be different from what we return (or could even have been
-       * removed in which case the put will re-establish). We do not and
-       * cannot guarantee more.
-       */
-      @Override public V setValue(V value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        V oldValue = Impl.this.put(getKey(), value);
-        this.value = value;
-        return oldValue;
-      }
-    }
-
-    final class EntryIterator extends HashIterator
-        implements Iterator<Entry<K, V>> {
-
-      public Entry<K, V> next() {
-        return nextEntry();
-      }
-    }
-
-    final class KeySet extends AbstractSet<K> {
-
-      public Iterator<K> iterator() {
-        return new KeyIterator();
-      }
-
-      public int size() {
-        return Impl.this.size();
-      }
-
-      @Override public boolean isEmpty() {
-        return Impl.this.isEmpty();
-      }
-
-      @Override public boolean contains(Object o) {
-        return Impl.this.containsKey(o);
-      }
-
-      @Override public boolean remove(Object o) {
-        return Impl.this.remove(o) != null;
-      }
-
-      @Override public void clear() {
-        Impl.this.clear();
-      }
-    }
-
-    final class Values extends AbstractCollection<V> {
-
-      public Iterator<V> iterator() {
-        return new ValueIterator();
-      }
-
-      public int size() {
-        return Impl.this.size();
-      }
-
-      @Override public boolean isEmpty() {
-        return Impl.this.isEmpty();
-      }
-
-      @Override public boolean contains(Object o) {
-        return Impl.this.containsValue(o);
-      }
-
-      @Override public void clear() {
-        Impl.this.clear();
-      }
-    }
-
-    final class EntrySet extends AbstractSet<Entry<K, V>> {
-
-      public Iterator<Entry<K, V>> iterator() {
-        return new EntryIterator();
-      }
-
-      @Override public boolean contains(Object o) {
-        if (!(o instanceof Entry)) {
-          return false;
-        }
-        Entry<?, ?> e = (Entry<?, ?>) o;
-        Object key = e.getKey();
-        if (key == null) {
-          return false;
-        }
-        V v = Impl.this.get(key);
-
-        return v != null && strategy.equalValues(v, e.getValue());
-      }
-
-      @Override public boolean remove(Object o) {
-        if (!(o instanceof Entry)) {
-          return false;
-        }
-        Entry<?, ?> e = (Entry<?, ?>) o;
-        Object key = e.getKey();
-        return key != null && Impl.this.remove(key, e.getValue());
-      }
-
-      public int size() {
-        return Impl.this.size();
-      }
-
-      @Override public boolean isEmpty() {
-        return Impl.this.isEmpty();
-      }
-
-      @Override public void clear() {
-        Impl.this.clear();
-      }
-    }
-
-    /* ---------------- Serialization Support -------------- */
-
-    private static final long serialVersionUID = 0;
-
-    private void writeObject(java.io.ObjectOutputStream out)
-        throws IOException {
-      out.writeInt(size());
-      out.writeFloat(loadFactor);
-      out.writeInt(segments.length); // concurrencyLevel
-      out.writeObject(strategy);
-      for (Entry<K, V> entry : entrySet()) {
-        out.writeObject(entry.getKey());
-        out.writeObject(entry.getValue());
-      }
-      out.writeObject(null); // terminate entries
-    }
-
-    /**
-     * Fields used during deserialization. We use a nested class so we don't
-     * load them until we need them. We need to use reflection to set final
-     * fields outside of the constructor.
-     */
-    static class Fields {
-
-      static final Field loadFactor = findField("loadFactor");
-      static final Field segmentShift = findField("segmentShift");
-      static final Field segmentMask = findField("segmentMask");
-      static final Field segments = findField("segments");
-      static final Field strategy = findField("strategy");
-
-      static Field findField(String name) {
-        try {
-          Field f = Impl.class.getDeclaredField(name);
-          f.setAccessible(true);
-          return f;
-        } catch (NoSuchFieldException e) {
-          throw new AssertionError(e);
-        }
-      }
-    }
-
-    @SuppressWarnings("unchecked")
-    private void readObject(java.io.ObjectInputStream in)
-        throws IOException, ClassNotFoundException {
-      try {
-        int initialCapacity = in.readInt();
-        float loadFactor = in.readFloat();
-        int concurrencyLevel = in.readInt();
-        Strategy<K, V, E> strategy = (Strategy<K, V, E>) in.readObject();
-
-        Fields.loadFactor.set(this, loadFactor);
-
-        if (concurrencyLevel > MAX_SEGMENTS) {
-          concurrencyLevel = MAX_SEGMENTS;
-        }
-
-        // Find power-of-two sizes best matching arguments
-        int segmentShift = 0;
-        int segmentCount = 1;
-        while (segmentCount < concurrencyLevel) {
-          ++segmentShift;
-          segmentCount <<= 1;
-        }
-        Fields.segmentShift.set(this, 32 - segmentShift);
-        Fields.segmentMask.set(this, segmentCount - 1);
-        Fields.segments.set(this, newSegmentArray(segmentCount));
-
-        if (initialCapacity > MAXIMUM_CAPACITY) {
-          initialCapacity = MAXIMUM_CAPACITY;
-        }
-
-        int segmentCapacity = initialCapacity / segmentCount;
-        if (segmentCapacity * segmentCount < initialCapacity) {
-          ++segmentCapacity;
-        }
-
-        int segmentSize = 1;
-        while (segmentSize < segmentCapacity) {
-            segmentSize <<= 1;
-        }
-        for (int i = 0; i < this.segments.length; ++i) {
-          this.segments[i] = new Segment(segmentSize);
-        }
-
-        Fields.strategy.set(this, strategy);
-
-        while (true) {
-          K key = (K) in.readObject();
-          if (key == null) {
-            break; // terminator
-          }
-          V value = (V) in.readObject();
-          put(key, value);
-        }
-      } catch (IllegalAccessException e) {
-        throw new AssertionError(e);
-      }
-    }
-  }
-
-  static class ComputingImpl<K, V, E> extends Impl<K, V, E> {
-
-    static final long serialVersionUID = 0;
-
-    final ComputingStrategy<K, V, E> computingStrategy;
-    final Function<? super K, ? extends V> computer;
-
-    /**
-     * Creates a new, empty map with the specified strategy, initial capacity,
-     * load factor and concurrency level.
-     */
-    ComputingImpl(ComputingStrategy<K, V, E> strategy, Builder builder,
-        Function<? super K, ? extends V> computer) {
-      super(strategy, builder);
-      this.computingStrategy = strategy;
-      this.computer = computer;
-    }
-
-    @Override public V get(Object k) {
-      /*
-       * This cast isn't safe, but we can rely on the fact that K is almost
-       * always passed to Map.get(), and tools like IDEs and Findbugs can
-       * catch situations where this isn't the case.
-       *
-       * The alternative is to add an overloaded method, but the chances of
-       * a user calling get() instead of the new API and the risks inherent
-       * in adding a new API outweigh this little hole.
-       */
-      @SuppressWarnings("unchecked")
-      K key = (K) k;
-
-      if (key == null) {
-        throw new NullPointerException("key");
-      }
-
-      int hash = hash(key);
-      Segment segment = segmentFor(hash);
-      outer: while (true) {
-        E entry = segment.getEntry(key, hash);
-        if (entry == null) {
-          boolean created = false;
-          segment.lock();
-          try {
-            // Try again--an entry could have materialized in the interim.
-            entry = segment.getEntry(key, hash);
-            if (entry == null) {
-              // Create a new entry.
-              created = true;
-              int count = segment.count;
-              if (count++ > segment.threshold) { // ensure capacity
-                segment.expand();
-              }
-              AtomicReferenceArray<E> table = segment.table;
-              int index = hash & (table.length() - 1);
-              E first = table.get(index);
-              ++segment.modCount;
-              entry = computingStrategy.newEntry(key, hash, first);
-              table.set(index, entry);
-              segment.count = count; // write-volatile
-            }
-          } finally {
-            segment.unlock();
-          }
-
-          if (created) {
-            // This thread solely created the entry.
-            boolean success = false;
-            try {
-              V value = computingStrategy.compute(key, entry, computer);
-              if (value == null) {
-                throw new NullPointerException(
-                    "compute() returned null unexpectedly");
-              }
-              success = true;
-              return value;
-            } finally {
-              if (!success) {
-                segment.removeEntry(entry, hash);
-              }
-            }
-          }
-        }
-
-        // The entry already exists. Wait for the computation.
-        boolean interrupted = false;
-        try {
-          while (true) {
-            try {
-              V value = computingStrategy.waitForValue(entry);
-              if (value == null) {
-                // Purge entry and try again.
-                segment.removeEntry(entry, hash);
-                continue outer;
-              }
-              return value;
-            } catch (InterruptedException e) {
-              interrupted = true;
-            }
-          }
-        } finally {
-          if (interrupted) {
-            Thread.currentThread().interrupt();
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   * A basic, no-frills implementation of {@code Strategy} using {@link
-   * SimpleInternalEntry}. Intended to be subclassed to provide customized
-   * behavior. For example, the following creates a map that uses byte arrays as
-   * keys: <pre>   {@code
-   *
-   *   return new CustomConcurrentHashMap.Builder().buildMap(
-   *       new SimpleStrategy<byte[], V>() {
-   *         public int hashKey(Object key) {
-   *           return Arrays.hashCode((byte[]) key);
-   *         }
-   *         public boolean equalKeys(byte[] a, Object b) {
-   *           return Arrays.equals(a, (byte[]) b);
-   *         }
-   *       });}</pre>
-   *
-   * With nothing overridden, it yields map behavior equivalent to that of
-   * {@link ConcurrentHashMap}.
-   */
-  static class SimpleStrategy<K, V>
-      implements Strategy<K, V, SimpleInternalEntry<K, V>> {
-    public SimpleInternalEntry<K, V> newEntry(
-        K key, int hash, SimpleInternalEntry<K, V> next) {
-      return new SimpleInternalEntry<K, V>(key, hash, null, next);
-    }
-    public SimpleInternalEntry<K, V> copyEntry(K key,
-        SimpleInternalEntry<K, V> original, SimpleInternalEntry<K, V> next) {
-      return new SimpleInternalEntry<K, V>(
-          key, original.hash, original.value, next);
-    }
-    public void setValue(SimpleInternalEntry<K, V> entry, V value) {
-      entry.value = value;
-    }
-    public V getValue(SimpleInternalEntry<K, V> entry) {
-      return entry.value;
-    }
-    public boolean equalKeys(K a, Object b) {
-      return a.equals(b);
-    }
-    public boolean equalValues(V a, Object b) {
-      return a.equals(b);
-    }
-    public int hashKey(Object key) {
-      return key.hashCode();
-    }
-    public K getKey(SimpleInternalEntry<K, V> entry) {
-      return entry.key;
-    }
-    public SimpleInternalEntry<K, V> getNext(SimpleInternalEntry<K, V> entry) {
-      return entry.next;
-    }
-    public int getHash(SimpleInternalEntry<K, V> entry) {
-      return entry.hash;
-    }
-    public void setInternals(
-        Internals<K, V, SimpleInternalEntry<K, V>> internals) {
-      // ignore?
-    }
-  }
-
-  /**
-   * A basic, no-frills entry class used by {@link SimpleInternalEntry}.
-   */
-  static class SimpleInternalEntry<K, V> {
-    final K key;
-    final int hash;
-    final SimpleInternalEntry<K, V> next;
-    volatile V value;
-    SimpleInternalEntry(
-        K key, int hash, @Nullable V value, SimpleInternalEntry<K, V> next) {
-      this.key = key;
-      this.hash = hash;
-      this.value = value;
-      this.next = next;
-    }
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/FinalizablePhantomReference.java b/core/src/com/google/inject/internal/util/FinalizablePhantomReference.java
deleted file mode 100644
index 386e9a8..0000000
--- a/core/src/com/google/inject/internal/util/FinalizablePhantomReference.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.lang.ref.PhantomReference;
-
-/**
- * Phantom reference with a {@code finalizeReferent()} method which a
- * background thread invokes after the garbage collector reclaims the
- * referent. This is a simpler alternative to using a {@link
- * java.lang.ref.ReferenceQueue}.
- *
- * <p>Unlike a normal phantom reference, this reference will be cleared
- * automatically.
- *
- * @author Bob Lee
- */
-public abstract class FinalizablePhantomReference<T>
-    extends PhantomReference<T> implements FinalizableReference {
-
-  /**
-   * Constructs a new finalizable phantom reference.
-   *
-   * @param referent to phantom reference
-   * @param queue that should finalize the referent
-   */
-  protected FinalizablePhantomReference(T referent,
-      FinalizableReferenceQueue queue) {
-    super(referent, queue.queue);
-    queue.cleanUp();
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/FinalizableReference.java b/core/src/com/google/inject/internal/util/FinalizableReference.java
deleted file mode 100644
index ef6654a..0000000
--- a/core/src/com/google/inject/internal/util/FinalizableReference.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * Implemented by references that have code to run after garbage collection of
- * their referents.
- *
- * @see FinalizableReferenceQueue
- * @author Bob Lee
- */
-public interface FinalizableReference {
-
-  /**
-   * Invoked on a background thread after the referent has been garbage
-   * collected unless security restictions prevented starting a background
-   * thread, in which case this method is invoked when new references
-   * are created.
-   */
-  void finalizeReferent();
-}
diff --git a/core/src/com/google/inject/internal/util/FinalizableReferenceQueue.java b/core/src/com/google/inject/internal/util/FinalizableReferenceQueue.java
deleted file mode 100644
index 4eebdbc..0000000
--- a/core/src/com/google/inject/internal/util/FinalizableReferenceQueue.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A reference queue with an associated background thread that dequeues
- * references and invokes {@link FinalizableReference#finalizeReferent()} on
- * them.
- *
- * <p>Keep a strong reference to this object until all of the associated
- * referents have been finalized. If this object is garbage collected earlier,
- * the backing thread will not invoke {@code finalizeReferent()} on the
- * remaining references.
- *
- * @author Bob Lee
- */
-public class FinalizableReferenceQueue {
-
-  /*
-   * The Finalizer thread keeps a phantom reference to this object. When the
-   * client (ReferenceMap, for example) no longer has a strong reference to
-   * this object, the garbage collector will reclaim it and enqueue the
-   * phantom reference. The enqueued reference will trigger the Finalizer to
-   * stop.
-   *
-   * If this library is loaded in the system class loader,
-   * FinalizableReferenceQueue can load Finalizer directly with no problems.
-   *
-   * If this library is loaded in an application class loader, it's important
-   * that Finalizer not have a strong reference back to the class loader.
-   * Otherwise, you could have a graph like this:
-   *
-   * Finalizer Thread
-   *   runs instance of -> Finalizer.class
-   *     loaded by -> Application class loader
-   *       which loaded -> ReferenceMap.class
-   *         which has a static -> FinalizableReferenceQueue instance
-   *
-   * Even if no other references to classes from the application class loader
-   * remain, the Finalizer thread keeps an indirect strong reference to the
-   * queue in ReferenceMap, which keeps the Finalizer running, and as a result,
-   * the application class loader can never be reclaimed.
-   *
-   * This means that dynamically loaded web applications and OSGi bundles can't
-   * be unloaded.
-   *
-   * If the library is loaded in an application class loader, we try to break
-   * the cycle by loading Finalizer in its own independent class loader:
-   *
-   * System class loader
-   *   -> Application class loader
-   *     -> ReferenceMap
-   *     -> FinalizableReferenceQueue
-   *     -> etc.
-   *   -> Decoupled class loader
-   *     -> Finalizer
-   *
-   * Now, Finalizer no longer keeps an indirect strong reference to the
-   * static FinalizableReferenceQueue field in ReferenceMap. The application
-   * class loader can be reclaimed at which point the Finalizer thread will
-   * stop and its decoupled class loader can also be reclaimed.
-   *
-   * If any of this fails along the way, we fall back to loading Finalizer
-   * directly in the application class loader.
-   */
-
-  private static final Logger logger
-      = Logger.getLogger(FinalizableReferenceQueue.class.getName());
-
-  private static final String FINALIZER_CLASS_NAME
-      = "com.google.inject.internal.util.Finalizer";
-
-  /** Reference to Finalizer.startFinalizer(). */
-  private static final Method startFinalizer;
-  static {
-    Class<?> finalizer = loadFinalizer(
-        new SystemLoader(), new DecoupledLoader(), new DirectLoader());
-    startFinalizer = getStartFinalizer(finalizer);
-  }
-
-  /**
-   * The actual reference queue that our background thread will poll.
-   */
-  final ReferenceQueue<Object> queue;
-
-  /**
-   * Whether or not the background thread started successfully.
-   */
-  final boolean threadStarted;
-
-  /**
-   * Constructs a new queue.
-   */
-  @SuppressWarnings("unchecked")
-  public FinalizableReferenceQueue() {
-    // We could start the finalizer lazily, but I'd rather it blow up early.
-    ReferenceQueue<Object> queue;
-    boolean threadStarted = false;
-    try {
-      queue = (ReferenceQueue<Object>) startFinalizer.invoke(null,
-          FinalizableReference.class, this);
-      threadStarted = true;
-    } catch (IllegalAccessException e) {
-      // Finalizer.startFinalizer() is public.
-      throw new AssertionError(e);
-    } catch (Throwable t) {
-      logger.log(Level.INFO, "Failed to start reference finalizer thread."
-          + " Reference cleanup will only occur when new references are"
-          + " created.", t);
-      queue = new ReferenceQueue<Object>();
-    }
-
-    this.queue = queue;
-    this.threadStarted = threadStarted;
-  }
-
-  /**
-   * Repeatedly dequeues references from the queue and invokes
-   * {@link FinalizableReference#finalizeReferent()} on them until the queue
-   * is empty. This method is a no-op if the background thread was created
-   * successfully.
-   */
-  void cleanUp() {
-    if (threadStarted) {
-      return;
-    }
-
-    Reference<?> reference;
-    while ((reference = queue.poll()) != null) {
-      /*
-       * This is for the benefit of phantom references. Weak and soft
-       * references will have already been cleared by this point.
-       */
-      reference.clear();
-      try {
-        ((FinalizableReference) reference).finalizeReferent();
-      } catch (Throwable t) {
-        logger.log(Level.SEVERE, "Error cleaning up after reference.", t);
-      }
-    }
-  }
-
-  /**
-   * Iterates through the given loaders until it finds one that can load
-   * Finalizer.
-   *
-   * @return Finalizer.class
-   */
-  private static Class<?> loadFinalizer(FinalizerLoader... loaders) {
-    for (FinalizerLoader loader : loaders) {
-      Class<?> finalizer = loader.loadFinalizer();
-      if (finalizer != null) {
-        return finalizer;
-      }
-    }
-
-    throw new AssertionError();
-  }
-
-  /**
-   * Loads Finalizer.class.
-   */
-  interface FinalizerLoader {
-
-    /**
-     * Returns Finalizer.class or null if this loader shouldn't or can't load
-     * it.
-     *
-     * @throws SecurityException if we don't have the appropriate priveleges
-     */
-    Class<?> loadFinalizer();
-  }
-
-  /**
-   * Tries to load Finalizer from the system class loader. If Finalizer is
-   * in the system class path, we needn't create a separate loader.
-   */
-  static class SystemLoader implements FinalizerLoader {
-    public Class<?> loadFinalizer() {
-      ClassLoader systemLoader;
-      try {
-        systemLoader = ClassLoader.getSystemClassLoader();
-      } catch (SecurityException e) {
-        logger.info("Not allowed to access system class loader.");
-        return null;
-      }
-      if (systemLoader != null) {
-        try {
-          return systemLoader.loadClass(FINALIZER_CLASS_NAME);
-        } catch (ClassNotFoundException e) {
-          // Ignore. Finalizer is simply in a child class loader.
-          return null;
-        }
-      } else {
-        return null;
-      }
-    }
-  }
-
-  /**
-   * Try to load Finalizer in its own class loader. If Finalizer's thread
-   * had a direct reference to our class loader (which could be that of
-   * a dynamically loaded web application or OSGi bundle), it would prevent
-   * our class loader from getting garbage collected.
-   */
-  static class DecoupledLoader implements FinalizerLoader {
-
-    private static final String LOADING_ERROR = "Could not load Finalizer in"
-        + " its own class loader. Loading Finalizer in the current class loader"
-        + " instead. As a result, you will not be able to garbage collect this"
-        + " class loader. To support reclaiming this class loader, either"
-        + " resolve the underlying issue, or move Google Collections to your"
-        + " system class path.";
-
-    public Class<?> loadFinalizer() {
-      try {
-        /*
-         * We use URLClassLoader because it's the only concrete class loader
-         * implementation in the JDK. If we used our own ClassLoader subclass,
-         * Finalizer would indirectly reference this class loader:
-         *
-         * Finalizer.class ->
-         *   CustomClassLoader ->
-         *     CustomClassLoader.class ->
-         *       This class loader
-         *
-         * System class loader will (and must) be the parent.
-         */
-        ClassLoader finalizerLoader = newLoader(getBaseUrl());
-        return finalizerLoader.loadClass(FINALIZER_CLASS_NAME);
-      } catch (Exception e) {
-        logger.log(Level.WARNING, LOADING_ERROR, e);
-        return null;
-      }
-    }
-
-    /**
-     * Gets URL for base of path containing Finalizer.class.
-     */
-    URL getBaseUrl() throws IOException {
-      // Find URL pointing to Finalizer.class file.
-      String finalizerPath = FINALIZER_CLASS_NAME.replace('.', '/') + ".class";
-      URL finalizerUrl = getClass().getClassLoader().getResource(finalizerPath);
-      if (finalizerUrl == null) {
-        throw new FileNotFoundException(finalizerPath);
-      }
-
-      // Find URL pointing to base of class path.
-      String urlString = finalizerUrl.toString();
-      if (!urlString.endsWith(finalizerPath)) {
-        throw new IOException("Unsupported path style: " + urlString);
-      }
-      urlString = urlString.substring(0,
-          urlString.length() - finalizerPath.length());
-      return new URL(urlString);
-    }
-
-    /** Creates a class loader with the given base URL as its classpath. */
-    URLClassLoader newLoader(URL base) {
-      return new URLClassLoader(new URL[] { base });
-    }
-  }
-
-  /**
-   * Loads Finalizer directly using the current class loader. We won't be
-   * able to garbage collect this class loader, but at least the world
-   * doesn't end.
-   */
-  static class DirectLoader implements FinalizerLoader {
-    public Class<?> loadFinalizer() {
-      try {
-        return Class.forName(FINALIZER_CLASS_NAME);
-      } catch (ClassNotFoundException e) {
-        throw new AssertionError(e);
-      }
-    }
-  }
-
-  /**
-   * Looks up Finalizer.startFinalizer().
-   */
-  static Method getStartFinalizer(Class<?> finalizer) {
-    try {
-      return finalizer.getMethod("startFinalizer", Class.class, Object.class);
-    } catch (NoSuchMethodException e) {
-      throw new AssertionError(e);
-    }
-  }
-}
-
diff --git a/core/src/com/google/inject/internal/util/FinalizableSoftReference.java b/core/src/com/google/inject/internal/util/FinalizableSoftReference.java
deleted file mode 100644
index 39d3570..0000000
--- a/core/src/com/google/inject/internal/util/FinalizableSoftReference.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.lang.ref.SoftReference;
-
-/**
- * Soft reference with a {@code finalizeReferent()} method which a background
- * thread invokes after the garbage collector reclaims the referent. This is a
- * simpler alternative to using a {@link java.lang.ref.ReferenceQueue}.
- *
- * @author Bob Lee
- */
-public abstract class FinalizableSoftReference<T> extends SoftReference<T>
-    implements FinalizableReference {
-
-  /**
-   * Consructs a new finalizable soft reference.
-   *
-   * @param referent to softly reference
-   * @param queue that should finalize the referent
-   */
-  protected FinalizableSoftReference(T referent,
-      FinalizableReferenceQueue queue) {
-    super(referent, queue.queue);
-    queue.cleanUp();
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/FinalizableWeakReference.java b/core/src/com/google/inject/internal/util/FinalizableWeakReference.java
deleted file mode 100644
index 0b8cd8e..0000000
--- a/core/src/com/google/inject/internal/util/FinalizableWeakReference.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.lang.ref.WeakReference;
-
-/**
- * Weak reference with a {@code finalizeReferent()} method which a background
- * thread invokes after the garbage collector reclaims the referent. This is a
- * simpler alternative to using a {@link java.lang.ref.ReferenceQueue}.
- *
- * @author Bob Lee
- */
-public abstract class FinalizableWeakReference<T> extends WeakReference<T>
-    implements FinalizableReference {
-
-  /**
-   * Consructs a new finalizable weak reference.
-   *
-   * @param referent to weakly reference
-   * @param queue that should finalize the referent
-   */
-  protected FinalizableWeakReference(T referent,
-      FinalizableReferenceQueue queue) {
-    super(referent, queue.queue);
-    queue.cleanUp();
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Finalizer.java b/core/src/com/google/inject/internal/util/Finalizer.java
deleted file mode 100644
index 6755196..0000000
--- a/core/src/com/google/inject/internal/util/Finalizer.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.lang.ref.PhantomReference;
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Method;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Thread that finalizes referents. All references should implement
- * {@code com.google.inject.internal.FinalizableReference}.
- *
- * <p>While this class is public, we consider it to be *internal* and not part
- * of our published API. It is public so we can access it reflectively across
- * class loaders in secure environments.
- *
- * <p>This class can't depend on other Google Collections code. If we were
- * to load this class in the same class loader as the rest of
- * Google Collections, this thread would keep an indirect strong reference
- * to the class loader and prevent it from being garbage collected. This
- * poses a problem for environments where you want to throw away the class
- * loader. For example, dynamically reloading a web application or unloading
- * an OSGi bundle.
- *
- * <p>{@code com.google.inject.internal.FinalizableReferenceQueue} loads this class
- * in its own class loader. That way, this class doesn't prevent the main
- * class loader from getting garbage collected, and this class can detect when
- * the main class loader has been garbage collected and stop itself.
- */
-public class Finalizer extends Thread {
-
-  private static final Logger logger
-      = Logger.getLogger(Finalizer.class.getName());
-
-  /** Name of FinalizableReference.class. */
-  private static final String FINALIZABLE_REFERENCE
-      = "com.google.inject.internal.util.FinalizableReference";
-
-  /**
-   * Starts the Finalizer thread. FinalizableReferenceQueue calls this method
-   * reflectively.
-   *
-   * @param finalizableReferenceClass FinalizableReference.class
-   * @param frq reference to instance of FinalizableReferenceQueue that started
-   *  this thread
-   * @return ReferenceQueue which Finalizer will poll
-   */
-  public static ReferenceQueue<Object> startFinalizer(
-      Class<?> finalizableReferenceClass, Object frq) {
-    /*
-     * We use FinalizableReference.class for two things:
-     *
-     * 1) To invoke FinalizableReference.finalizeReferent()
-     *
-     * 2) To detect when FinalizableReference's class loader has to be garbage
-     * collected, at which point, Finalizer can stop running
-     */
-    if (!finalizableReferenceClass.getName().equals(FINALIZABLE_REFERENCE)) {
-      throw new IllegalArgumentException(
-          "Expected " + FINALIZABLE_REFERENCE + ".");
-    }
-
-    Finalizer finalizer = new Finalizer(finalizableReferenceClass, frq);
-    finalizer.start();
-    return finalizer.queue;
-  }
-
-  private final WeakReference<Class<?>> finalizableReferenceClassReference;
-  private final PhantomReference<Object> frqReference;
-  private final ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
-
-  /** Constructs a new finalizer thread. */
-  private Finalizer(Class<?> finalizableReferenceClass, Object frq) {
-    super(Finalizer.class.getName());
-
-    this.finalizableReferenceClassReference
-        = new WeakReference<Class<?>>(finalizableReferenceClass);
-
-    // Keep track of the FRQ that started us so we know when to stop.
-    this.frqReference = new PhantomReference<Object>(frq, queue);
-
-    setDaemon(true);
-
-    // TODO: Priority?
-  }
-
-  /**
-   * Loops continuously, pulling references off the queue and cleaning them up.
-   */
-  @SuppressWarnings("InfiniteLoopStatement")
-  @Override
-  public void run() {
-    try {
-      while (true) {
-        try {
-          cleanUp(queue.remove());
-        } catch (InterruptedException e) { /* ignore */ }
-      }
-    } catch (ShutDown shutDown) { /* ignore */ }
-  }
-
-  /**
-   * Cleans up a single reference. Catches and logs all throwables.
-   */
-  private void cleanUp(Reference<?> reference) throws ShutDown {
-    Method finalizeReferentMethod = getFinalizeReferentMethod();
-    do {
-      /*
-       * This is for the benefit of phantom references. Weak and soft
-       * references will have already been cleared by this point.
-       */
-      reference.clear();
-
-      if (reference == frqReference) {
-        /*
-         * The client no longer has a reference to the
-         * FinalizableReferenceQueue. We can stop.
-         */
-        throw new ShutDown();
-      }
-
-      try {
-        finalizeReferentMethod.invoke(reference);
-      } catch (Throwable t) {
-        logger.log(Level.SEVERE, "Error cleaning up after reference.", t);
-      }
-
-      /*
-       * Loop as long as we have references available so as not to waste
-       * CPU looking up the Method over and over again.
-       */
-    } while ((reference = queue.poll()) != null);
-  }
-
-  /**
-   * Looks up FinalizableReference.finalizeReferent() method.
-   */
-  private Method getFinalizeReferentMethod() throws ShutDown {
-    Class<?> finalizableReferenceClass
-        = finalizableReferenceClassReference.get();
-    if (finalizableReferenceClass == null) {
-      /*
-       * FinalizableReference's class loader was reclaimed. While there's a
-       * chance that other finalizable references could be enqueued
-       * subsequently (at which point the class loader would be resurrected
-       * by virtue of us having a strong reference to it), we should pretty
-       * much just shut down and make sure we don't keep it alive any longer
-       * than necessary.
-       */
-      throw new ShutDown();
-    }
-    try {
-      return finalizableReferenceClass.getMethod("finalizeReferent");
-    } catch (NoSuchMethodException e) {
-      throw new AssertionError(e);
-    }
-  }
-
-  /** Indicates that it's time to shut down the Finalizer. */
-  @SuppressWarnings("serial") // Never serialized or thrown out of this class.
-  private static class ShutDown extends Exception { }
-}
diff --git a/core/src/com/google/inject/internal/util/Function.java b/core/src/com/google/inject/internal/util/Function.java
deleted file mode 100644
index 0e2264c..0000000
--- a/core/src/com/google/inject/internal/util/Function.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-
-/**
- * A transformation from one object to another. For example, a
- * {@code StringToIntegerFunction} may implement
- * <code>Function&lt;String,Integer&gt;</code> and transform integers in
- * {@code String} format to {@code Integer} format.
- *
- * <p>The transformation on the source object does not necessarily result in
- * an object of a different type.  For example, a
- * {@code FarenheitToCelsiusFunction} may implement
- * <code>Function&lt;Float,Float&gt;</code>.
- *
- * <p>Implementations which may cause side effects upon evaluation are strongly
- * encouraged to state this fact clearly in their API documentation.
- * 
- * <p>This interface may be used with the Google Web Toolkit (GWT).
- *
- * @param <F> the type of the function input
- * @param <T> the type of the function output 
- * @author Kevin Bourrillion
- * @author Scott Bonneau
- */
-public interface Function<F, T> {
-
-  /**
-   * Applies the function to an object of type {@code F}, resulting in an object
-   * of type {@code T}.  Note that types {@code F} and {@code T} may or may not
-   * be the same.
-   * 
-   * @param from the source object
-   * @return the resulting object
-   */
-  T apply(@Nullable F from);
-
-  /**
-   * Indicates whether some other object is equal to this {@code Function}.
-   * This method can return {@code true} <i>only</i> if the specified object is
-   * also a {@code Function} and, for every input object {@code o}, it returns
-   * exactly the same value.  Thus, {@code function1.equals(function2)} implies
-   * that either {@code function1.apply(o)} and {@code function2.apply(o)} are
-   * both null, or {@code function1.apply(o).equals(function2.apply(o))}.
-   *
-   * <p>Note that it is always safe <em>not</em> to override
-   * {@link Object#equals}.
-   */
-  boolean equals(@Nullable Object obj);
-}
diff --git a/core/src/com/google/inject/internal/util/Hashing.java b/core/src/com/google/inject/internal/util/Hashing.java
deleted file mode 100644
index b0fb165..0000000
--- a/core/src/com/google/inject/internal/util/Hashing.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * Static methods for implementing hash-based collections.
- *
- * @author Kevin Bourrillion
- * @author Jesse Wilson
- */
-final class Hashing {
-  private Hashing() {}
-
-  /*
-   * This method was written by Doug Lea with assistance from members of JCP
-   * JSR-166 Expert Group and released to the public domain, as explained at
-   * http://creativecommons.org/licenses/publicdomain
-   */
-  static int smear(int hashCode) {
-    hashCode ^= (hashCode >>> 20) ^ (hashCode >>> 12);
-    return hashCode ^ (hashCode >>> 7) ^ (hashCode >>> 4);
-  }
-
-  // We use power-of-2 tables, and this is the highest int that's a power of 2
-  private static final int MAX_TABLE_SIZE = 1 << 30;
-
-  // If the set has this many elements, it will "max out" the table size
-  private static final int CUTOFF = 1 << 29;
-
-  // Size the table to be at most 50% full, if possible
-  static int chooseTableSize(int setSize) {
-    if (setSize < CUTOFF) {
-      return Integer.highestOneBit(setSize) << 2;
-    }
-
-    // The table can't be completely full or we'll get infinite reprobes
-    Preconditions.checkArgument(setSize < MAX_TABLE_SIZE, "collection too large");
-    return MAX_TABLE_SIZE;
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/ImmutableCollection.java b/core/src/com/google/inject/internal/util/ImmutableCollection.java
deleted file mode 100644
index 7b272f2..0000000
--- a/core/src/com/google/inject/internal/util/ImmutableCollection.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * An immutable collection. Does not permit null elements.
- *
- * <p><b>Note</b>: Although this class is not final, it cannot be subclassed
- * outside of this package as it has no public or protected constructors. Thus,
- * instances of this type are guaranteed to be immutable.
- *
- * @author Jesse Wilson
- */
-@SuppressWarnings("serial") // we're overriding default serialization
-public abstract class ImmutableCollection<E>
-    implements Collection<E>, Serializable {
-  static final ImmutableCollection<Object> EMPTY_IMMUTABLE_COLLECTION
-      = new EmptyImmutableCollection();
-
-  /** Copied here for GWT compatibility. */
-  private static final Object[] EMPTY_ARRAY = new Object[0];
-  private static final UnmodifiableIterator<Object> EMPTY_ITERATOR
-      = new UnmodifiableIterator<Object>() {
-    public boolean hasNext() {
-      return false;
-    }
-    public Object next() {
-      throw new NoSuchElementException();
-    }
-  };
-
-  ImmutableCollection() {}
-
-  /**
-   * Returns an unmodifiable iterator across the elements in this collection.
-   */
-  public abstract UnmodifiableIterator<E> iterator();
-
-  public Object[] toArray() {
-    Object[] newArray = new Object[size()];
-    return toArray(newArray);
-  }
-
-  public <T> T[] toArray(T[] other) {
-    int size = size();
-    if (other.length < size) {
-      other = ObjectArrays.newArray(other, size);
-    } else if (other.length > size) {
-      other[size] = null;
-    }
-    int index = 0;
-    for (E element : this) {
-      /*
-       * Sleazy fake cast. However, if element is not a T, then the very next
-       * line must fail with an ArrayStoreException, so we should be safe.
-       */
-      @SuppressWarnings("unchecked")
-      T elementAsT = (T) element;
-
-      other[index++] = elementAsT;
-    }
-    return other;
-  }
-
-  public boolean contains(@Nullable Object object) {
-    if (object == null) {
-      return false;
-    }
-    for (E element : this) {
-      if (element.equals(object)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  public boolean containsAll(Collection<?> targets) {
-    for (Object target : targets) {
-      if (!contains(target)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  public boolean isEmpty() {
-    return size() == 0;
-  }
-
-  @Override public String toString() {
-    StringBuilder sb = new StringBuilder(size() * 16);
-    sb.append('[');
-    Iterator<E> i = iterator();
-    if (i.hasNext()) {
-      sb.append(i.next());
-    }
-    while (i.hasNext()) {
-      sb.append(", ");
-      sb.append(i.next());
-    }
-    return sb.append(']').toString();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the collection unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean add(E e) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the collection unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean remove(Object object) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the collection unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean addAll(Collection<? extends E> newElements) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the collection unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean removeAll(Collection<?> oldElements) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the collection unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean retainAll(Collection<?> elementsToKeep) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the collection unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final void clear() {
-    throw new UnsupportedOperationException();
-  }
-
-  private static class EmptyImmutableCollection
-      extends ImmutableCollection<Object> {
-    public int size() {
-      return 0;
-    }
-
-    @Override public boolean isEmpty() {
-      return true;
-    }
-
-    @Override public boolean contains(@Nullable Object object) {
-      return false;
-    }
-
-    @Override public UnmodifiableIterator<Object> iterator() {
-      return EMPTY_ITERATOR;
-    }
-
-    @Override public Object[] toArray() {
-      return EMPTY_ARRAY;
-    }
-
-    @Override public <T> T[] toArray(T[] array) {
-      if (array.length > 0) {
-        array[0] = null;
-      }
-      return array;
-    }
-  }
-
-  private static class ArrayImmutableCollection<E>
-      extends ImmutableCollection<E> {
-    private final E[] elements;
-
-    ArrayImmutableCollection(E[] elements) {
-      this.elements = elements;
-    }
-
-    public int size() {
-      return elements.length;
-    }
-
-    @Override public boolean isEmpty() {
-      return false;
-    }
-
-    @Override public UnmodifiableIterator<E> iterator() {
-      return new UnmodifiableIterator<E>() {
-        int i = 0;
-        public boolean hasNext() {
-          return i < elements.length;
-        }
-        public E next() {
-          if (!hasNext()) {
-            throw new NoSuchElementException();
-          }
-          return elements[i++];
-        }
-      };
-    }
-  }
-
-  /*
-   * Serializes ImmutableCollections as their logical contents. This ensures
-   * that implementation types do not leak into the serialized representation.
-   */
-  private static class SerializedForm implements Serializable {
-    final Object[] elements;
-    SerializedForm(Object[] elements) {
-      this.elements = elements;
-    }
-    Object readResolve() {
-      return elements.length == 0
-          ? EMPTY_IMMUTABLE_COLLECTION
-          : new ArrayImmutableCollection<Object>(elements.clone());
-    }
-    private static final long serialVersionUID = 0;
-  }
-
-  Object writeReplace() {
-    return new SerializedForm(toArray());
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/ImmutableEntry.java b/core/src/com/google/inject/internal/util/ImmutableEntry.java
deleted file mode 100644
index b740563..0000000
--- a/core/src/com/google/inject/internal/util/ImmutableEntry.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.Serializable;
-
-/**
- * @see Maps#immutableEntry(Object,Object)
- */
-class ImmutableEntry<K, V> extends AbstractMapEntry<K, V>
-    implements Serializable {
-  private final K key;
-  private final V value;
-
-  ImmutableEntry(@Nullable K key, @Nullable V value) {
-    this.key = key;
-    this.value = value;
-  }
-
-  @Override public K getKey() {
-    return key;
-  }
-
-  @Override public V getValue() {
-    return value;
-  }
-  private static final long serialVersionUID = 0;
-}
diff --git a/core/src/com/google/inject/internal/util/ImmutableList.java b/core/src/com/google/inject/internal/util/ImmutableList.java
deleted file mode 100644
index 63c7e44..0000000
--- a/core/src/com/google/inject/internal/util/ImmutableList.java
+++ /dev/null
@@ -1,678 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.InvalidObjectException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import java.util.RandomAccess;
-
-/**
- * A high-performance, immutable, random-access {@code List} implementation.
- * Does not permit null elements.
- *
- * <p>Unlike {@link Collections#unmodifiableList}, which is a <i>view</i> of a
- * separate collection that can still change, an instance of {@code
- * ImmutableList} contains its own private data and will <i>never</i> change.
- * {@code ImmutableList} is convenient for {@code public static final} lists
- * ("constant lists") and also lets you easily make a "defensive copy" of a list
- * provided to your class by a caller.
- *
- * <p><b>Note</b>: Although this class is not final, it cannot be subclassed as
- * it has no public or protected constructors. Thus, instances of this type are
- * guaranteed to be immutable.
- *
- * @see ImmutableMap
- * @see ImmutableSet
- * @author Kevin Bourrillion
- */
-@SuppressWarnings("serial") // we're overriding default serialization
-public abstract class ImmutableList<E> extends ImmutableCollection<E>
-    implements List<E>, RandomAccess {
-  private static final ImmutableList<?> EMPTY_IMMUTABLE_LIST
-      = new EmptyImmutableList();
-
-  /**
-   * Returns the empty immutable list. This set behaves and performs comparably
-   * to {@link Collections#emptyList}, and is preferable mainly for consistency
-   * and maintainability of your code.
-   */
-  // Casting to any type is safe because the list will never hold any elements.
-  @SuppressWarnings("unchecked")
-  public static <E> ImmutableList<E> of() {
-    return (ImmutableList<E>) EMPTY_IMMUTABLE_LIST;
-  }
-
-  /**
-   * Returns an immutable list containing a single element. This list behaves
-   * and performs comparably to {@link Collections#singleton}, but will not
-   * accept a null element. It is preferable mainly for consistency and
-   * maintainability of your code.
-   *
-   * @throws NullPointerException if {@code element} is null
-   */
-  public static <E> ImmutableList<E> of(E element) {
-    // TODO: evaluate a specialized SingletonImmutableList
-    return new RegularImmutableList<E>(copyIntoArray(element));
-  }
-
-  // TODO: Add similar overloadings to ImmutableSet and ImmutableSortedSet
-
-  /**
-   * Returns an immutable list containing the given elements, in order.
-   *
-   * @throws NullPointerException if any element is null
-   */
-  public static <E> ImmutableList<E> of(E e1, E e2) {
-    return new RegularImmutableList<E>(copyIntoArray(e1, e2));
-  }
-
-  /**
-   * Returns an immutable list containing the given elements, in order.
-   *
-   * @throws NullPointerException if any element is null
-   */
-  public static <E> ImmutableList<E> of(E e1, E e2, E e3) {
-    return new RegularImmutableList<E>(copyIntoArray(e1, e2, e3));
-  }
-
-  /**
-   * Returns an immutable list containing the given elements, in order.
-   *
-   * @throws NullPointerException if any element is null
-   */
-  public static <E> ImmutableList<E> of(E e1, E e2, E e3, E e4) {
-    return new RegularImmutableList<E>(copyIntoArray(e1, e2, e3, e4));
-  }
-
-  /**
-   * Returns an immutable list containing the given elements, in order.
-   *
-   * @throws NullPointerException if any element is null
-   */
-  public static <E> ImmutableList<E> of(E e1, E e2, E e3, E e4, E e5) {
-    return new RegularImmutableList<E>(copyIntoArray(e1, e2, e3, e4, e5));
-  }
-
-  /**
-   * Returns an immutable list containing the given elements, in order.
-   *
-   * @throws NullPointerException if any of {@code elements} is null
-   */
-  public static <E> ImmutableList<E> of(E... elements) {
-    return (elements.length == 0)
-        ? ImmutableList.<E>of()
-        : new RegularImmutableList<E>(copyIntoArray(elements));
-  }
-
-  /**
-   * Returns an immutable list containing the given elements, in order. This
-   * method iterates over {@code elements} at most once. Note that if {@code
-   * list} is a {@code List<String>}, then {@code ImmutableList.copyOf(list)}
-   * returns an {@code ImmutableList<String>} containing each of the strings
-   * in {@code list}, while ImmutableList.of(list)} returns an {@code
-   * ImmutableList<List<String>>} containing one element (the given list
-   * itself).
-   *
-   * <p><b>Note:</b> Despite what the method name suggests, if {@code elements}
-   * is an {@code ImmutableList}, no copy will actually be performed, and the
-   * given list itself will be returned.
-   *
-   * @throws NullPointerException if any of {@code elements} is null
-   */
-  public static <E> ImmutableList<E> copyOf(Iterable<? extends E> elements) {
-    if (elements instanceof ImmutableList) {
-      /*
-       * TODO: If the given ImmutableList is a sublist, copy the referenced
-       * portion of the array into a new array to save space?
-       */
-      @SuppressWarnings("unchecked") // all supported methods are covariant
-      ImmutableList<E> list = (ImmutableList<E>) elements;
-      return list;
-    } else if (elements instanceof Collection) {
-      @SuppressWarnings("unchecked")
-      Collection<? extends E> coll = (Collection<? extends E>) elements;
-      return copyOfInternal(coll);
-    } else {
-      return copyOfInternal(Lists.newArrayList(elements));
-    }
-  }
-
-  /**
-   * Returns an immutable list containing the given elements, in order.
-   *
-   * @throws NullPointerException if any of {@code elements} is null
-   */
-  public static <E> ImmutableList<E> copyOf(Iterator<? extends E> elements) {
-    return copyOfInternal(Lists.newArrayList(elements));
-  }
-
-  private static <E> ImmutableList<E> copyOfInternal(
-      ArrayList<? extends E> list) {
-    return (list.isEmpty())
-        ? ImmutableList.<E>of()
-        : new RegularImmutableList<E>(nullChecked(list.toArray()));
-  }
-
-  /**
-   * Checks that all the array elements are non-null.
-   *
-   * @return the argument array
-   * @throws NullPointerException if any element is null
-   */
-  private static Object[] nullChecked(Object[] array) {
-    for (int i = 0, len = array.length; i < len; i++) {
-      if (array[i] == null) {
-        throw new NullPointerException("at index " + i);
-      }
-    }
-    return array;
-  }
-
-  private static <E> ImmutableList<E> copyOfInternal(
-      Collection<? extends E> collection) {
-    int size = collection.size();
-    return (size == 0)
-        ? ImmutableList.<E>of()
-        : ImmutableList.<E>createFromIterable(collection, size);
-  }
-
-  private ImmutableList() {}
-
-  // This declaration is needed to make List.iterator() and
-  // ImmutableCollection.iterator() consistent.
-  @Override public abstract UnmodifiableIterator<E> iterator();
-
-  // Mark these two methods with @Nullable
-
-  public abstract int indexOf(@Nullable Object object);
-
-  public abstract int lastIndexOf(@Nullable Object object);
-
-  // constrain the return type to ImmutableList<E>
-
-  /**
-   * Returns an immutable list of the elements between the specified {@code
-   * fromIndex}, inclusive, and {@code toIndex}, exclusive. (If {@code
-   * fromIndex} and {@code toIndex} are equal, the empty immutable list is
-   * returned.)
-   */
-  public abstract ImmutableList<E> subList(int fromIndex, int toIndex);
-
-  /**
-   * Guaranteed to throw an exception and leave the list unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean addAll(int index, Collection<? extends E> newElements) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the list unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final E set(int index, E element) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the list unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final void add(int index, E element) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the list unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final E remove(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  private static final class EmptyImmutableList extends ImmutableList<Object> {
-    public int size() {
-      return 0;
-    }
-
-    @Override public boolean isEmpty() {
-      return true;
-    }
-
-    @Override public boolean contains(Object target) {
-      return false;
-    }
-
-    @Override public UnmodifiableIterator<Object> iterator() {
-      return Iterators.emptyIterator();
-    }
-
-    private static final Object[] EMPTY_ARRAY = new Object[0];
-
-    @Override public Object[] toArray() {
-      return EMPTY_ARRAY;
-    }
-
-    @Override public <T> T[] toArray(T[] a) {
-      if (a.length > 0) {
-        a[0] = null;
-      }
-      return a;
-    }
-
-    public Object get(int index) {
-      // guaranteed to fail, but at least we get a consistent message
-      Preconditions.checkElementIndex(index, 0);
-      throw new AssertionError("unreachable");
-    }
-
-    @Override public int indexOf(Object target) {
-      return -1;
-    }
-
-    @Override public int lastIndexOf(Object target) {
-      return -1;
-    }
-
-    @Override public ImmutableList<Object> subList(int fromIndex, int toIndex) {
-      Preconditions.checkPositionIndexes(fromIndex, toIndex, 0);
-      return this;
-    }
-
-    public ListIterator<Object> listIterator() {
-      return Iterators.emptyListIterator();
-    }
-
-    public ListIterator<Object> listIterator(int start) {
-      Preconditions.checkPositionIndex(start, 0);
-      return Iterators.emptyListIterator();
-    }
-
-    @Override public boolean containsAll(Collection<?> targets) {
-      return targets.isEmpty();
-    }
-
-    @Override public boolean equals(@Nullable Object object) {
-      if (object instanceof List) {
-        List<?> that = (List<?>) object;
-        return that.isEmpty();
-      }
-      return false;
-    }
-
-    @Override public int hashCode() {
-      return 1;
-    }
-
-    @Override public String toString() {
-      return "[]";
-    }
-  }
-
-  private static final class RegularImmutableList<E> extends ImmutableList<E> {
-    private final int offset;
-    private final int size;
-    private final Object[] array;
-
-    private RegularImmutableList(Object[] array, int offset, int size) {
-      this.offset = offset;
-      this.size = size;
-      this.array = array;
-    }
-
-    private RegularImmutableList(Object[] array) {
-      this(array, 0, array.length);
-    }
-
-    public int size() {
-      return size;
-    }
-
-    @Override public boolean isEmpty() {
-      return false;
-    }
-
-    @Override public boolean contains(Object target) {
-      return indexOf(target) != -1;
-    }
-
-    // The fake cast to E is safe because the creation methods only allow E's
-    @SuppressWarnings("unchecked")
-    @Override public UnmodifiableIterator<E> iterator() {
-      return (UnmodifiableIterator<E>) Iterators.forArray(array, offset, size);
-    }
-
-    @Override public Object[] toArray() {
-      Object[] newArray = new Object[size()];
-      System.arraycopy(array, offset, newArray, 0, size);
-      return newArray;
-    }
-
-    @Override public <T> T[] toArray(T[] other) {
-      if (other.length < size) {
-        other = ObjectArrays.newArray(other, size);
-      } else if (other.length > size) {
-        other[size] = null;
-      }
-      System.arraycopy(array, offset, other, 0, size);
-      return other;
-    }
-
-    // The fake cast to E is safe because the creation methods only allow E's
-    @SuppressWarnings("unchecked")
-    public E get(int index) {
-      Preconditions.checkElementIndex(index, size);
-      return (E) array[index + offset];
-    }
-
-    @Override public int indexOf(Object target) {
-      if (target != null) {
-        for (int i = offset; i < offset + size; i++) {
-          if (array[i].equals(target)) {
-            return i - offset;
-          }
-        }
-      }
-      return -1;
-    }
-
-    @Override public int lastIndexOf(Object target) {
-      if (target != null) {
-        for (int i = offset + size - 1; i >= offset; i--) {
-          if (array[i].equals(target)) {
-            return i - offset;
-          }
-        }
-      }
-      return -1;
-    }
-
-    @Override public ImmutableList<E> subList(int fromIndex, int toIndex) {
-      Preconditions.checkPositionIndexes(fromIndex, toIndex, size);
-      return (fromIndex == toIndex)
-          ? ImmutableList.<E>of()
-          : new RegularImmutableList<E>(
-              array, offset + fromIndex, toIndex - fromIndex);
-    }
-
-    public ListIterator<E> listIterator() {
-      return listIterator(0);
-    }
-
-    public ListIterator<E> listIterator(final int start) {
-      Preconditions.checkPositionIndex(start, size);
-
-      return new ListIterator<E>() {
-        int index = start;
-
-        public boolean hasNext() {
-          return index < size;
-        }
-        public boolean hasPrevious() {
-          return index > 0;
-        }
-
-        public int nextIndex() {
-          return index;
-        }
-        public int previousIndex() {
-          return index - 1;
-        }
-
-        public E next() {
-          E result;
-          try {
-            result = get(index);
-          } catch (IndexOutOfBoundsException rethrown) {
-            throw new NoSuchElementException();
-          }
-          index++;
-          return result;
-        }
-        public E previous() {
-          E result;
-          try {
-            result = get(index - 1);
-          } catch (IndexOutOfBoundsException rethrown) {
-            throw new NoSuchElementException();
-          }
-          index--;
-          return result;
-        }
-
-        public void set(E o) {
-          throw new UnsupportedOperationException();
-        }
-        public void add(E o) {
-          throw new UnsupportedOperationException();
-        }
-        public void remove() {
-          throw new UnsupportedOperationException();
-        }
-      };
-    }
-
-    @Override public boolean equals(@Nullable Object object) {
-      if (object == this) {
-        return true;
-      }
-      if (!(object instanceof List)) {
-        return false;
-      }
-
-      List<?> that = (List<?>) object;
-      if (this.size() != that.size()) {
-        return false;
-      }
-
-      int index = offset;
-      if (object instanceof RegularImmutableList) {
-        RegularImmutableList<?> other = (RegularImmutableList<?>) object;
-        for (int i = other.offset; i < other.offset + other.size; i++) {
-          if (!array[index++].equals(other.array[i])) {
-            return false;
-          }
-        }
-      } else {
-        for (Object element : that) {
-          if (!array[index++].equals(element)) {
-            return false;
-          }
-        }
-      }
-      return true;
-    }
-
-    @Override public int hashCode() {
-      // not caching hash code since it could change if the elements are mutable
-      // in a way that modifies their hash codes
-      int hashCode = 1;
-      for (int i = offset; i < offset + size; i++) {
-        hashCode = 31 * hashCode + array[i].hashCode();
-      }
-      return hashCode;
-    }
-
-    @Override public String toString() {
-      StringBuilder sb = new StringBuilder(size() * 16);
-      sb.append('[').append(array[offset]);
-      for (int i = offset + 1; i < offset + size; i++) {
-        sb.append(", ").append(array[i]);
-      }
-      return sb.append(']').toString();
-    }
-  }
-
-  private static Object[] copyIntoArray(Object... source) {
-    Object[] array = new Object[source.length];
-    int index = 0;
-    for (Object element : source) {
-      if (element == null) {
-        throw new NullPointerException("at index " + index);
-      }
-      array[index++] = element;
-    }
-    return array;
-  }
-
-  private static <E> ImmutableList<E> createFromIterable(
-      Iterable<?> source, int estimatedSize) {
-    Object[] array = new Object[estimatedSize];
-    int index = 0;
-
-    for (Object element : source) {
-      if (index == estimatedSize) {
-        // At least one element was added after our call to size().
-        estimatedSize = ((estimatedSize / 2) + 1) * 3;
-        array = copyOf(array, estimatedSize);
-      }
-      if (element == null) {
-        throw new NullPointerException("at index " + index);
-      }
-      array[index++] = element;
-    }
-
-    if (index == 0) {
-      return of();
-    }
-
-    if (index != estimatedSize) {
-      array = copyOf(array, index);
-    }
-
-    return new RegularImmutableList<E>(array, 0, index);
-  }
-
-  // Avoid using Arrays.copyOf(), which is not present until JDK6.
-  private static Object[] copyOf(Object[] oldArray, int newSize) {
-    Object[] newArray = new Object[newSize];
-    System.arraycopy(oldArray, 0, newArray, 0,
-        Math.min(oldArray.length, newSize));
-    return newArray;
-  }
-
-  /*
-   * Serializes ImmutableLists as their logical contents. This ensures that
-   * implementation types do not leak into the serialized representation.
-   */
-  private static class SerializedForm implements Serializable {
-    final Object[] elements;
-    SerializedForm(Object[] elements) {
-      this.elements = elements;
-    }
-    Object readResolve() {
-      return of(elements);
-    }
-    private static final long serialVersionUID = 0;
-  }
-
-  private void readObject(ObjectInputStream stream)
-      throws InvalidObjectException {
-    throw new InvalidObjectException("Use SerializedForm");
-  }
-
-  @Override Object writeReplace() {
-    return new SerializedForm(toArray());
-  }
-
-  /**
-   * Returns a new builder. The generated builder is equivalent to the builder
-   * created by the {@link Builder} constructor.
-   */
-  public static <E> Builder<E> builder() {
-    return new Builder<E>();
-  }
-
-  /**
-   * A builder for creating immutable list instances, especially
-   * {@code public static final} lists ("constant lists").
-   *
-   * <p>Example:
-   * <pre>{@code
-   *   public static final ImmutableList<Color> GOOGLE_COLORS
-   *       = new ImmutableList.Builder<Color>()
-   *           .addAll(WEBSAFE_COLORS)
-   *           .add(new Color(0, 191, 255))
-   *           .build();}</pre>
-   *
-   * <p>Builder instances can be reused - it is safe to call {@link #build}
-   * multiple times to build multiple lists in series. Each new list
-   * contains the one created before it.
-   */
-  public static class Builder<E> {
-    private final ArrayList<E> contents = Lists.newArrayList();
-
-    /**
-     * Creates a new builder. The returned builder is equivalent to the builder
-     * generated by {@link ImmutableList#builder}.
-     */
-    public Builder() {}
-
-    /**
-     * Adds {@code element} to the {@code ImmutableList}.
-     *
-     * @param element the element to add
-     * @return this {@code Builder} object
-     * @throws NullPointerException if {@code element} is null
-     */
-    public Builder<E> add(E element) {
-      Preconditions.checkNotNull(element, "element cannot be null");
-      contents.add(element);
-      return this;
-    }
-
-    /**
-     * Adds each element of {@code elements} to the {@code ImmutableList}.
-     *
-     * @param elements the {@code Iterable} to add to the {@code ImmutableList}
-     * @return this {@code Builder} object
-     * @throws NullPointerException if {@code elements} is or contains null
-     */
-    public Builder<E> addAll(Iterable<? extends E> elements) {
-      if (elements instanceof Collection) {
-        @SuppressWarnings("unchecked")
-        Collection<? extends E> collection = (Collection<? extends E>) elements;
-        contents.ensureCapacity(contents.size() + collection.size());
-      }
-      for (E elem : elements) {
-        Preconditions.checkNotNull(elem, "elements contains a null");
-        contents.add(elem);
-      }
-      return this;
-    }
-
-    /**
-     * Returns a newly-created {@code ImmutableList} based on the contents of
-     * the {@code Builder}.
-     */
-    public ImmutableList<E> build() {
-      return copyOf(contents);
-    }
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/ImmutableMap.java b/core/src/com/google/inject/internal/util/ImmutableMap.java
deleted file mode 100644
index e411988..0000000
--- a/core/src/com/google/inject/internal/util/ImmutableMap.java
+++ /dev/null
@@ -1,779 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * An immutable, hash-based {@link Map} with reliable user-specified iteration
- * order. Does not permit null keys or values.
- *
- * <p>Unlike {@link Collections#unmodifiableMap}, which is a <i>view</i> of a
- * separate map which can still change, an instance of {@code ImmutableMap}
- * contains its own data and will <i>never</i> change. {@code ImmutableMap} is
- * convenient for {@code public static final} maps ("constant maps") and also
- * lets you easily make a "defensive copy" of a map provided to your class by a
- * caller.
- *
- * <p><b>Note</b>: Although this class is not final, it cannot be subclassed as
- * it has no public or protected constructors. Thus, instances of this class are
- * guaranteed to be immutable.
- *
- * @see ImmutableList
- * @see ImmutableSet
- * @author Jesse Wilson
- * @author Kevin Bourrillion
- */
-@SuppressWarnings("serial") // we're overriding default serialization
-public abstract class ImmutableMap<K, V>
-    implements ConcurrentMap<K, V>, Serializable {
-  private static final ImmutableMap<?, ?> EMPTY_IMMUTABLE_MAP
-      = new EmptyImmutableMap();
-
-  // TODO: restore prebuilder API?  optimize, compare performance to HashMap
-
-  /**
-   * Returns the empty map. This map behaves and performs comparably to
-   * {@link Collections#emptyMap}, and is preferable mainly for consistency
-   * and maintainability of your code.
-   */
-  // Casting to any type is safe because the set will never hold any elements.
-  @SuppressWarnings("unchecked")
-  public static <K, V> ImmutableMap<K, V> of() {
-    return (ImmutableMap<K, V>) EMPTY_IMMUTABLE_MAP;
-  }
-
-  /**
-   * Returns an immutable map containing a single entry. This map behaves and
-   * performs comparably to {@link Collections#singletonMap} but will not accept
-   * a null key or value. It is preferable mainly for consistency and
-   * maintainability of your code.
-   */
-  public static <K, V> ImmutableMap<K, V> of(K k1, V v1) {
-    return new SingletonImmutableMap<K, V>(
-        Preconditions.checkNotNull(k1), Preconditions.checkNotNull(v1));
-  }
-
-  /**
-   * Returns an immutable map containing the given entries, in order.
-   *
-   * @throws IllegalArgumentException if duplicate keys are added
-   */
-  public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2) {
-    return new RegularImmutableMap<K, V>(entryOf(k1, v1), entryOf(k2, v2));
-  }
-
-  /**
-   * Returns an immutable map containing the given entries, in order.
-   *
-   * @throws IllegalArgumentException if duplicate keys are added
-   */
-  public static <K, V> ImmutableMap<K, V> of(
-      K k1, V v1, K k2, V v2, K k3, V v3) {
-    return new RegularImmutableMap<K, V>(
-        entryOf(k1, v1), entryOf(k2, v2), entryOf(k3, v3));
-  }
-
-  /**
-   * Returns an immutable map containing the given entries, in order.
-   *
-   * @throws IllegalArgumentException if duplicate keys are added
-   */
-  public static <K, V> ImmutableMap<K, V> of(
-      K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
-    return new RegularImmutableMap<K, V>(
-        entryOf(k1, v1), entryOf(k2, v2), entryOf(k3, v3), entryOf(k4, v4));
-  }
-
-  /**
-   * Returns an immutable map containing the given entries, in order.
-   *
-   * @throws IllegalArgumentException if duplicate keys are added
-   */
-  public static <K, V> ImmutableMap<K, V> of(
-      K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
-    return new RegularImmutableMap<K, V>(entryOf(k1, v1),
-        entryOf(k2, v2), entryOf(k3, v3), entryOf(k4, v4), entryOf(k5, v5));
-  }
-
-  // looking for of() with > 5 entries? Use the builder instead.
-
-  /**
-   * Returns a new builder. The generated builder is equivalent to the builder
-   * created by the {@link Builder} constructor.
-   */
-  public static <K, V> Builder<K, V> builder() {
-    return new Builder<K, V>();
-  }
-
-  /**
-   * Verifies that {@code key} and {@code value} are non-null, and returns a new
-   * entry with those values.
-   */
-  private static <K, V> Entry<K, V> entryOf(K key, V value) {
-    return Maps.immutableEntry(Preconditions.checkNotNull(key), Preconditions.checkNotNull(value));
-  }
-
-  /**
-   * A builder for creating immutable map instances, especially {@code public
-   * static final} maps ("constant maps"). Example: <pre>   {@code
-   *
-   *   static final ImmutableMap<String, Integer> WORD_TO_INT =
-   *       new ImmutableMap.Builder<String, Integer>()
-   *           .put("one", 1)
-   *           .put("two", 2)
-   *           .put("three", 3)
-   *           .build();}</pre>
-   *
-   * For <i>small</i> immutable maps, the {@code ImmutableMap.of()} methods are
-   * even more convenient.
-   *
-   * <p>Builder instances can be reused - it is safe to call {@link #build}
-   * multiple times to build multiple maps in series. Each map is a superset of
-   * the maps created before it.
-   */
-  public static class Builder<K, V> {
-    final List<Entry<K, V>> entries = Lists.newArrayList();
-
-    /**
-     * Creates a new builder. The returned builder is equivalent to the builder
-     * generated by {@link ImmutableMap#builder}.
-     */
-    public Builder() {}
-
-    /**
-     * Associates {@code key} with {@code value} in the built map. Duplicate
-     * keys are not allowed, and will cause {@link #build} to fail.
-     */
-    public Builder<K, V> put(K key, V value) {
-      entries.add(entryOf(key, value));
-      return this;
-    }
-
-    /**
-     * Associates all of {@code map's} keys and values in the built map.
-     * Duplicate keys are not allowed, and will cause {@link #build} to fail.
-     *
-     * @throws NullPointerException if any key or value in {@code map} is null
-     */
-    public Builder<K, V> putAll(Map<? extends K, ? extends V> map) {
-      for (Entry<? extends K, ? extends V> entry : map.entrySet()) {
-        put(entry.getKey(), entry.getValue());
-      }
-      return this;
-    }
-
-    // TODO: Should build() and the ImmutableBiMap version throw an
-    // IllegalStateException instead?
-
-    /**
-     * Returns a newly-created immutable map.
-     *
-     * @throws IllegalArgumentException if duplicate keys were added
-     */
-    public ImmutableMap<K, V> build() {
-      return fromEntryList(entries);
-    }
-
-    private static <K, V> ImmutableMap<K, V> fromEntryList(
-        List<Entry<K, V>> entries) {
-      int size = entries.size();
-      switch (size) {
-        case 0:
-          return of();
-        case 1:
-          return new SingletonImmutableMap<K, V>(Iterables.getOnlyElement(entries));
-        default:
-          Entry<?, ?>[] entryArray
-              = entries.toArray(new Entry<?, ?>[entries.size()]);
-          return new RegularImmutableMap<K, V>(entryArray);
-      }
-    }
-  }
-
-  /**
-   * Returns an immutable map containing the same entries as {@code map}. If
-   * {@code map} somehow contains entries with duplicate keys (for example, if
-   * it is a {@code SortedMap} whose comparator is not <i>consistent with
-   * equals</i>), the results of this method are undefined.
-   *
-   * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is an
-   * {@code ImmutableMap}, no copy will actually be performed, and the given map
-   * itself will be returned.
-   *
-   * @throws NullPointerException if any key or value in {@code map} is null
-   */
-  public static <K, V> ImmutableMap<K, V> copyOf(
-      Map<? extends K, ? extends V> map) {
-    if (map instanceof ImmutableMap) {
-      @SuppressWarnings("unchecked") // safe since map is not writable
-      ImmutableMap<K, V> kvMap = (ImmutableMap<K, V>) map;
-      return kvMap;
-    }
-
-    int size = map.size();
-    switch (size) {
-      case 0:
-        return of();
-      case 1:
-        Map.Entry<? extends K, ? extends V> loneEntry
-            = Iterables.getOnlyElement(map.entrySet());
-        /*
-         * Must cast next line to (K) and (V) to avoid returning an
-         * ImmutableMap<? extends K, ? extends V>, which is incompatible
-         * with the return type ImmutableMap<K, V>.  (Eclipse will complain
-         * mightily about this line if there's no cast.)
-         */
-        return of((K) loneEntry.getKey(), (V) loneEntry.getValue());
-      default:
-        Entry<?, ?>[] array = new Entry<?, ?>[size];
-        int i = 0;
-        for (Entry<? extends K, ? extends V> entry : map.entrySet()) {
-          /*
-           * See comment above re: <? extends K, ? extends V> to <K, V>.
-           */
-          array[i++] = entryOf((K) entry.getKey(), (V) entry.getValue());
-        }
-        return new RegularImmutableMap<K, V>(array);
-    }
-  }
-
-  ImmutableMap() {}
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final V put(K k, V v) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final V remove(Object o) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final V putIfAbsent(K key, V value) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean remove(Object key, Object value) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final boolean replace(K key, V oldValue, V newValue) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final V replace(K key, V value) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final void putAll(Map<? extends K, ? extends V> map) {
-    throw new UnsupportedOperationException();
-  }
-
-  /**
-   * Guaranteed to throw an exception and leave the map unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final void clear() {
-    throw new UnsupportedOperationException();
-  }
-
-  // Overriding to mark it Nullable
-  public abstract boolean containsKey(@Nullable Object key);
-
-  // Overriding to mark it Nullable
-  public abstract boolean containsValue(@Nullable Object value);
-
-  // Overriding to mark it Nullable
-  public abstract V get(@Nullable Object key);
-
-  /**
-   * Returns an immutable set of the mappings in this map. The entries are in
-   * the same order as the parameters used to build this map.
-   */
-  public abstract ImmutableSet<Entry<K, V>> entrySet();
-
-  /**
-   * Returns an immutable set of the keys in this map. These keys are in
-   * the same order as the parameters used to build this map.
-   */
-  public abstract ImmutableSet<K> keySet();
-
-  /**
-   * Returns an immutable collection of the values in this map. The values are
-   * in the same order as the parameters used to build this map.
-   */
-  public abstract ImmutableCollection<V> values();
-
-  @Override public boolean equals(@Nullable Object object) {
-    if (object == this) {
-      return true;
-    }
-    if (object instanceof Map) {
-      Map<?, ?> that = (Map<?, ?>) object;
-      return this.entrySet().equals(that.entrySet());
-    }
-    return false;
-  }
-
-  @Override public int hashCode() {
-    // not caching hash code since it could change if map values are mutable
-    // in a way that modifies their hash codes
-    return entrySet().hashCode();
-  }
-
-  @Override public String toString() {
-    StringBuilder result = new StringBuilder(size() * 16).append('{');
-    Iterator<Entry<K, V>> entries = entrySet().iterator();
-    result.append(entries.next());
-    while (entries.hasNext()) {
-      result.append(", ").append(entries.next());
-    }
-    return result.append('}').toString();
-  }
-
-  private static final class EmptyImmutableMap
-      extends ImmutableMap<Object, Object> {
-
-    @Override public Object get(Object key) {
-      return null;
-    }
-
-    public int size() {
-      return 0;
-    }
-
-    public boolean isEmpty() {
-      return true;
-    }
-
-    @Override public boolean containsKey(Object key) {
-      return false;
-    }
-
-    @Override public boolean containsValue(Object value) {
-      return false;
-    }
-
-    @Override public ImmutableSet<Entry<Object, Object>> entrySet() {
-      return ImmutableSet.of();
-    }
-
-    @Override public ImmutableSet<Object> keySet() {
-      return ImmutableSet.of();
-    }
-
-    @Override public ImmutableCollection<Object> values() {
-      return ImmutableCollection.EMPTY_IMMUTABLE_COLLECTION;
-    }
-
-    @Override public boolean equals(@Nullable Object object) {
-      if (object instanceof Map) {
-        Map<?, ?> that = (Map<?, ?>) object;
-        return that.isEmpty();
-      }
-      return false;
-    }
-
-    @Override public int hashCode() {
-      return 0;
-    }
-
-    @Override public String toString() {
-      return "{}";
-    }
-  }
-
-  private static final class SingletonImmutableMap<K, V>
-      extends ImmutableMap<K, V> {
-    private transient final K singleKey;
-    private transient final V singleValue;
-    private transient Entry<K, V> entry;
-
-    private SingletonImmutableMap(K singleKey, V singleValue) {
-      this.singleKey = singleKey;
-      this.singleValue = singleValue;
-    }
-
-    private SingletonImmutableMap(Entry<K, V> entry) {
-      this.entry = entry;
-      this.singleKey = entry.getKey();
-      this.singleValue = entry.getValue();
-    }
-
-    private Entry<K, V> entry() {
-      Entry<K, V> e = entry;
-      return (e == null)
-          ? (entry = Maps.immutableEntry(singleKey, singleValue)) : e;
-    }
-
-    @Override public V get(Object key) {
-      return singleKey.equals(key) ? singleValue : null;
-    }
-
-    public int size() {
-      return 1;
-    }
-
-    public boolean isEmpty() {
-      return false;
-    }
-
-    @Override public boolean containsKey(Object key) {
-      return singleKey.equals(key);
-    }
-
-    @Override public boolean containsValue(Object value) {
-      return singleValue.equals(value);
-    }
-
-    private transient ImmutableSet<Entry<K, V>> entrySet;
-
-    @Override public ImmutableSet<Entry<K, V>> entrySet() {
-      ImmutableSet<Entry<K, V>> es = entrySet;
-      return (es == null) ? (entrySet = ImmutableSet.of(entry())) : es;
-    }
-
-    private transient ImmutableSet<K> keySet;
-
-    @Override public ImmutableSet<K> keySet() {
-      ImmutableSet<K> ks = keySet;
-      return (ks == null) ? (keySet = ImmutableSet.of(singleKey)) : ks;
-    }
-
-    private transient ImmutableCollection<V> values;
-
-    @Override public ImmutableCollection<V> values() {
-      ImmutableCollection<V> v = values;
-      return (v == null) ? (values = new Values<V>(singleValue)) : v;
-    }
-
-    private static class Values<V> extends ImmutableCollection<V> {
-      final V singleValue;
-
-      Values(V singleValue) {
-        this.singleValue = singleValue;
-      }
-
-      @Override public boolean contains(Object object) {
-        return singleValue.equals(object);
-      }
-
-      @Override public boolean isEmpty() {
-        return false;
-      }
-
-      public int size() {
-        return 1;
-      }
-
-      @Override public UnmodifiableIterator<V> iterator() {
-        return Iterators.singletonIterator(singleValue);
-      }
-    }
-
-    @Override public boolean equals(@Nullable Object object) {
-      if (object == this) {
-        return true;
-      }
-      if (object instanceof Map) {
-        Map<?, ?> that = (Map<?, ?>) object;
-        if (that.size() != 1) {
-          return false;
-        }
-        Map.Entry<?, ?> entry = that.entrySet().iterator().next();
-        return singleKey.equals(entry.getKey())
-            && singleValue.equals(entry.getValue());
-      }
-      return false;
-    }
-
-    @Override public int hashCode() {
-      return singleKey.hashCode() ^ singleValue.hashCode();
-    }
-
-    @Override public String toString() {
-      return new StringBuilder()
-          .append('{')
-          .append(singleKey.toString())
-          .append('=')
-          .append(singleValue.toString())
-          .append('}')
-          .toString();
-    }
-  }
-
-  private static final class RegularImmutableMap<K, V>
-      extends ImmutableMap<K, V> {
-    private transient final Entry<K, V>[] entries; // entries in insertion order
-    private transient final Object[] table; // alternating keys and values
-    // 'and' with an int then shift to get a table index
-    private transient final int mask;
-    private transient final int keySetHashCode;
-
-    private RegularImmutableMap(Entry<?, ?>... entries) {
-      // each of our 6 callers carefully put only Entry<K, V>s into the array!
-      @SuppressWarnings("unchecked")
-      Entry<K, V>[] tmp = (Entry<K, V>[]) entries;
-      this.entries = tmp;
-
-      int tableSize = Hashing.chooseTableSize(entries.length);
-      table = new Object[tableSize * 2];
-      mask = tableSize - 1;
-
-      int keySetHashCodeMutable = 0;
-      for (Entry<K, V> entry : this.entries) {
-        K key = entry.getKey();
-        int keyHashCode = key.hashCode();
-        for (int i = Hashing.smear(keyHashCode); true; i++) {
-          int index = (i & mask) * 2;
-          Object existing = table[index];
-          if (existing == null) {
-            V value = entry.getValue();
-            table[index] = key;
-            table[index + 1] = value;
-            keySetHashCodeMutable += keyHashCode;
-            break;
-          } else if (existing.equals(key)) {
-            throw new IllegalArgumentException("duplicate key: " + key);
-          }
-        }
-      }
-      keySetHashCode = keySetHashCodeMutable;
-    }
-
-    @Override public V get(Object key) {
-      if (key == null) {
-        return null;
-      }
-      for (int i = Hashing.smear(key.hashCode()); true; i++) {
-        int index = (i & mask) * 2;
-        Object candidate = table[index];
-        if (candidate == null) {
-          return null;
-        }
-        if (candidate.equals(key)) {
-          // we're careful to store only V's at odd indices
-          @SuppressWarnings("unchecked")
-          V value = (V) table[index + 1];
-          return value;
-        }
-      }
-    }
-
-    public int size() {
-      return entries.length;
-    }
-
-    public boolean isEmpty() {
-      return false;
-    }
-
-    @Override public boolean containsKey(Object key) {
-      return get(key) != null;
-    }
-
-    @Override public boolean containsValue(Object value) {
-      if (value == null) {
-        return false;
-      }
-      for (Entry<K, V> entry : entries) {
-        if (entry.getValue().equals(value)) {
-          return true;
-        }
-      }
-      return false;
-    }
-
-    // TODO: Serialization of the map views should serialize the map, and
-    // deserialization should call entrySet(), keySet(), or values() on the
-    // deserialized map. The views are serializable since the Immutable* classes
-    // are.
-
-    private transient ImmutableSet<Entry<K, V>> entrySet;
-
-    @Override public ImmutableSet<Entry<K, V>> entrySet() {
-      ImmutableSet<Entry<K, V>> es = entrySet;
-      return (es == null) ? (entrySet = new EntrySet<K, V>(this)) : es;
-    }
-
-    private static class EntrySet<K, V> extends ImmutableSet.ArrayImmutableSet<Entry<K, V>> {
-      final RegularImmutableMap<K, V> map;
-
-      EntrySet(RegularImmutableMap<K, V> map) {
-        super(map.entries);
-        this.map = map;
-      }
-
-      @Override public boolean contains(Object target) {
-        if (target instanceof Entry) {
-          Entry<?, ?> entry = (Entry<?, ?>) target;
-          V mappedValue = map.get(entry.getKey());
-          return mappedValue != null && mappedValue.equals(entry.getValue());
-        }
-        return false;
-      }
-    }
-
-    private transient ImmutableSet<K> keySet;
-
-    @Override public ImmutableSet<K> keySet() {
-      ImmutableSet<K> ks = keySet;
-      return (ks == null) ? (keySet = new KeySet<K, V>(this)) : ks;
-    }
-
-    private static class KeySet<K, V>
-        extends ImmutableSet.TransformedImmutableSet<Entry<K, V>, K> {
-      final RegularImmutableMap<K, V> map;
-
-      KeySet(RegularImmutableMap<K, V> map) {
-        super(map.entries, map.keySetHashCode);
-        this.map = map;
-      }
-
-      @Override K transform(Entry<K, V> element) {
-        return element.getKey();
-      }
-
-      @Override public boolean contains(Object target) {
-        return map.containsKey(target);
-      }
-    }
-
-    private transient ImmutableCollection<V> values;
-
-    @Override public ImmutableCollection<V> values() {
-      ImmutableCollection<V> v = values;
-      return (v == null) ? (values = new Values<V>(this)) : v;
-    }
-
-    private static class Values<V> extends ImmutableCollection<V>  {
-      final RegularImmutableMap<?, V> map;
-
-      Values(RegularImmutableMap<?, V> map) {
-        this.map = map;
-      }
-
-      public int size() {
-        return map.entries.length;
-      }
-
-      @Override public boolean isEmpty() {
-        return false;
-      }
-
-      @Override public UnmodifiableIterator<V> iterator() {
-        Iterator<V> iterator = new AbstractIterator<V>() {
-          int index = 0;
-          @Override protected V computeNext() {
-            return (index < map.entries.length)
-                ? map.entries[index++].getValue()
-                : endOfData();
-          }
-        };
-        // Though the AbstractIterator is unmodifiable, it isn't an
-        // UnmodifiableIterator.
-        return Iterators.unmodifiableIterator(iterator);
-      }
-
-      @Override public boolean contains(Object target) {
-        return map.containsValue(target);
-      }
-    }
-
-    @Override public String toString() {
-      StringBuilder result = new StringBuilder(size() * 16)
-          .append('{')
-          .append(entries[0]);
-      for (int e = 1; e < entries.length; e++) {
-        result.append(", ").append(entries[e].toString());
-      }
-      return result.append('}').toString();
-    }
-  }
-
-  /*
-   * Serialized type for all ImmutableMap instances. It captures the logical
-   * contents and they are reconstructed using public factory methods. This
-   * ensures that the implementation types remain as implementation details.
-   */
-  private static class SerializedForm implements Serializable {
-    final Object[] keys;
-    final Object[] values;
-    SerializedForm(ImmutableMap<?, ?> map) {
-      keys = new Object[map.size()];
-      values = new Object[map.size()];
-      int i = 0;
-      for (Entry<?, ?> entry : map.entrySet()) {
-        keys[i] = entry.getKey();
-        values[i] = entry.getValue();
-        i++;
-      }
-    }
-    Object readResolve() {
-      Builder<Object, Object> builder = new Builder<Object, Object>();
-      for (int i = 0; i < keys.length; i++) {
-        builder.put(keys[i], values[i]);
-      }
-      return builder.build();
-    }
-    private static final long serialVersionUID = 0;
-  }
-
-  Object writeReplace() {
-    return new SerializedForm(this);
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/ImmutableSet.java b/core/src/com/google/inject/internal/util/ImmutableSet.java
deleted file mode 100644
index 1a84ae6..0000000
--- a/core/src/com/google/inject/internal/util/ImmutableSet.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-/**
- * A high-performance, immutable {@code Set} with reliable, user-specified
- * iteration order. Does not permit null elements.
- *
- * <p>Unlike {@link Collections#unmodifiableSet}, which is a <i>view</i> of a
- * separate collection that can still change, an instance of this class contains
- * its own private data and will <i>never</i> change. This class is convenient
- * for {@code public static final} sets ("constant sets") and also lets you
- * easily make a "defensive copy" of a set provided to your class by a caller.
- *
- * <p><b>Warning:</b> Like most sets, an {@code ImmutableSet} will not function
- * correctly if an element is modified after being placed in the set. For this
- * reason, and to avoid general confusion, it is strongly recommended to place
- * only immutable objects into this collection.
- *
- * <p>This class has been observed to perform significantly better than {@link
- * HashSet} for objects with very fast {@link Object#hashCode} implementations
- * (as a well-behaved immutable object should). While this class's factory
- * methods create hash-based instances, the {@link ImmutableSortedSet} subclass
- * performs binary searches instead.
- *
- * <p><b>Note</b>: Although this class is not final, it cannot be subclassed
- * outside its package as it has no public or protected constructors. Thus,
- * instances of this type are guaranteed to be immutable.
- *
- * @see ImmutableList
- * @see ImmutableMap
- * @author Kevin Bourrillion
- * @author Nick Kralevich
- */
-@SuppressWarnings("serial") // we're overriding default serialization
-public abstract class ImmutableSet<E> extends ImmutableCollection<E>
-    implements Set<E> {
-  private static final ImmutableSet<?> EMPTY_IMMUTABLE_SET
-      = new EmptyImmutableSet();
-
-  /**
-   * Returns the empty immutable set. This set behaves and performs comparably
-   * to {@link Collections#emptySet}, and is preferable mainly for consistency
-   * and maintainability of your code.
-   */
-  // Casting to any type is safe because the set will never hold any elements.
-  @SuppressWarnings({"unchecked"})
-  public static <E> ImmutableSet<E> of() {
-    return (ImmutableSet<E>) EMPTY_IMMUTABLE_SET;
-  }
-
-  /**
-   * Returns an immutable set containing a single element. This set behaves and
-   * performs comparably to {@link Collections#singleton}, but will not accept
-   * a null element. It is preferable mainly for consistency and
-   * maintainability of your code.
-   */
-  public static <E> ImmutableSet<E> of(E element) {
-    return new SingletonImmutableSet<E>(element, element.hashCode());
-  }
-
-  /**
-   * Returns an immutable set containing the given elements, in order. Repeated
-   * occurrences of an element (according to {@link Object#equals}) after the
-   * first are ignored (but too many of these may result in the set being
-   * sized inappropriately).
-   *
-   * @throws NullPointerException if any of {@code elements} is null
-   */
-  public static <E> ImmutableSet<E> of(E... elements) {
-    switch (elements.length) {
-      case 0:
-        return of();
-      case 1:
-        return of(elements[0]);
-      default:
-        return create(Arrays.asList(elements), elements.length);
-    }
-  }
-
-  /**
-   * Returns an immutable set containing the given elements, in order. Repeated
-   * occurrences of an element (according to {@link Object#equals}) after the
-   * first are ignored (but too many of these may result in the set being
-   * sized inappropriately). This method iterates over {@code elements} at most
-   * once.
-   *
-   * <p>Note that if {@code s} is a {@code Set<String>}, then {@code
-   * ImmutableSet.copyOf(s)} returns an {@code ImmutableSet<String>} containing
-   * each of the strings in {@code s}, while {@code ImmutableSet.of(s)} returns
-   * a {@code ImmutableSet<Set<String>>} containing one element (the given set
-   * itself).
-   *
-   * <p><b>Note:</b> Despite what the method name suggests, if {@code elements}
-   * is an {@code ImmutableSet} (but not an {@code ImmutableSortedSet}), no copy
-   * will actually be performed, and the given set itself will be returned.
-   *
-   * @throws NullPointerException if any of {@code elements} is null
-   */
-  public static <E> ImmutableSet<E> copyOf(Iterable<? extends E> elements) {
-    if (elements instanceof ImmutableSet) {
-      @SuppressWarnings("unchecked") // all supported methods are covariant
-      ImmutableSet<E> set = (ImmutableSet<E>) elements;
-      return set;
-    }
-    return copyOfInternal(Collections2.toCollection(elements));
-  }
-
-  /**
-   * Returns an immutable set containing the given elements, in order. Repeated
-   * occurrences of an element (according to {@link Object#equals}) after the
-   * first are ignored.
-   *
-   * @throws NullPointerException if any of {@code elements} is null
-   */
-  public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) {
-    Collection<E> list = Lists.newArrayList(elements);
-    return copyOfInternal(list);
-  }
-
-  private static <E> ImmutableSet<E> copyOfInternal(
-      Collection<? extends E> collection) {
-    // TODO: Support concurrent collections that change while this method is
-    // running.
-    switch (collection.size()) {
-      case 0:
-        return of();
-      case 1:
-        // TODO: Remove "ImmutableSet.<E>" when eclipse bug is fixed.
-        return ImmutableSet.<E>of(collection.iterator().next());
-      default:
-        return create(collection, collection.size());
-    }
-  }
-
-  ImmutableSet() {}
-
-  /** Returns {@code true} if the {@code hashCode()} method runs quickly. */
-  boolean isHashCodeFast() {
-    return false;
-  }
-
-  @Override public boolean equals(@Nullable Object object) {
-    if (object == this) {
-      return true;
-    }
-    if (object instanceof ImmutableSet
-        && isHashCodeFast()
-        && ((ImmutableSet<?>) object).isHashCodeFast()
-        && hashCode() != object.hashCode()) {
-      return false;
-    }
-    return Collections2.setEquals(this, object);
-  }
-
-  @Override public int hashCode() {
-    int hashCode = 0;
-    for (Object o : this) {
-      hashCode += o.hashCode();
-    }
-    return hashCode;
-  }
-
-  // This declaration is needed to make Set.iterator() and
-  // ImmutableCollection.iterator() consistent.
-  @Override public abstract UnmodifiableIterator<E> iterator();
-
-  @Override public String toString() {
-    if (isEmpty()) {
-      return "[]";
-    }
-    Iterator<E> iterator = iterator();
-    StringBuilder result = new StringBuilder(size() * 16);
-    result.append('[').append(iterator.next().toString());
-    for (int i = 1; i < size(); i++) {
-      result.append(", ").append(iterator.next().toString());
-    }
-    return result.append(']').toString();
-  }
-
-  private static final class EmptyImmutableSet extends ImmutableSet<Object> {
-    public int size() {
-      return 0;
-    }
-
-    @Override public boolean isEmpty() {
-      return true;
-    }
-
-    @Override public boolean contains(Object target) {
-      return false;
-    }
-
-    @Override public UnmodifiableIterator<Object> iterator() {
-      return Iterators.emptyIterator();
-    }
-
-    private static final Object[] EMPTY_ARRAY = new Object[0];
-
-    @Override public Object[] toArray() {
-      return EMPTY_ARRAY;
-    }
-
-    @Override public <T> T[] toArray(T[] a) {
-      if (a.length > 0) {
-        a[0] = null;
-      }
-      return a;
-    }
-
-    @Override public boolean containsAll(Collection<?> targets) {
-      return targets.isEmpty();
-    }
-
-    @Override public boolean equals(@Nullable Object object) {
-      if (object instanceof Set) {
-        Set<?> that = (Set<?>) object;
-        return that.isEmpty();
-      }
-      return false;
-    }
-
-    @Override public final int hashCode() {
-      return 0;
-    }
-
-    @Override boolean isHashCodeFast() {
-      return true;
-    }
-
-    @Override public String toString() {
-      return "[]";
-    }
-  }
-
-  private static final class SingletonImmutableSet<E> extends ImmutableSet<E> {
-    final E element;
-    final int hashCode;
-
-    SingletonImmutableSet(E element, int hashCode) {
-      this.element = element;
-      this.hashCode = hashCode;
-    }
-
-    public int size() {
-      return 1;
-    }
-
-    @Override public boolean isEmpty() {
-      return false;
-    }
-
-    @Override public boolean contains(Object target) {
-      return element.equals(target);
-    }
-
-    @Override public UnmodifiableIterator<E> iterator() {
-      return Iterators.singletonIterator(element);
-    }
-
-    @Override public Object[] toArray() {
-      return new Object[] { element };
-    }
-
-    @SuppressWarnings({"unchecked"})
-    @Override public <T> T[] toArray(T[] array) {
-      if (array.length == 0) {
-        array = ObjectArrays.newArray(array, 1);
-      } else if (array.length > 1) {
-        array[1] = null;
-      }
-      array[0] = (T) element;
-      return array;
-    }
-
-    @Override public boolean equals(@Nullable Object object) {
-      if (object == this) {
-        return true;
-      }
-      if (object instanceof Set) {
-        Set<?> that = (Set<?>) object;
-        return that.size() == 1 && element.equals(that.iterator().next());
-      }
-      return false;
-    }
-
-    @Override public final int hashCode() {
-      return hashCode;
-    }
-
-    @Override boolean isHashCodeFast() {
-      return true;
-    }
-
-    @Override public String toString() {
-      String elementToString = element.toString();
-      return new StringBuilder(elementToString.length() + 2)
-          .append('[')
-          .append(elementToString)
-          .append(']')
-          .toString();
-    }
-  }
-
-  private static <E> ImmutableSet<E> create(
-      Iterable<? extends E> iterable, int count) {
-    // count is always the (nonzero) number of elements in the iterable
-    int tableSize = Hashing.chooseTableSize(count);
-    Object[] table = new Object[tableSize];
-    int mask = tableSize - 1;
-
-    List<E> elements = new ArrayList<E>(count);
-    int hashCode = 0;
-
-    for (E element : iterable) {
-      int hash = element.hashCode();
-      for (int i = Hashing.smear(hash); true; i++) {
-        int index = i & mask;
-        Object value = table[index];
-        if (value == null) {
-          // Came to an empty bucket. Put the element here.
-          table[index] = element;
-          elements.add(element);
-          hashCode += hash;
-          break;
-        } else if (value.equals(element)) {
-          break; // Found a duplicate. Nothing to do.
-        }
-      }
-    }
-
-    // The iterable might have contained only duplicates of the same element.
-    return (elements.size() == 1)
-        ? new SingletonImmutableSet<E>(elements.get(0), hashCode)
-        : new RegularImmutableSet<E>(elements.toArray(), hashCode, table, mask);
-  }
-
-  abstract static class ArrayImmutableSet<E> extends ImmutableSet<E> {
-    final Object[] elements; // the elements (two or more) in the desired order
-
-    ArrayImmutableSet(Object[] elements) {
-      this.elements = elements;
-    }
-
-    public int size() {
-      return elements.length;
-    }
-
-    @Override public boolean isEmpty() {
-      return false;
-    }
-
-    /*
-     * The cast is safe because the only way to create an instance is via the
-     * create() method above, which only permits elements of type E.
-     */
-    @SuppressWarnings("unchecked")
-    @Override public UnmodifiableIterator<E> iterator() {
-      return (UnmodifiableIterator<E>) Iterators.forArray(elements);
-    }
-
-    @Override public Object[] toArray() {
-      Object[] array = new Object[size()];
-      System.arraycopy(elements, 0, array, 0, size());
-      return array;
-    }
-
-    @Override public <T> T[] toArray(T[] array) {
-      int size = size();
-      if (array.length < size) {
-        array = ObjectArrays.newArray(array, size);
-      } else if (array.length > size) {
-        array[size] = null;
-      }
-      System.arraycopy(elements, 0, array, 0, size);
-      return array;
-    }
-
-    @Override public boolean containsAll(Collection<?> targets) {
-      if (targets == this) {
-        return true;
-      }
-      if (!(targets instanceof ArrayImmutableSet)) {
-        return super.containsAll(targets);
-      }
-      if (targets.size() > size()) {
-        return false;
-      }
-      for (Object target : ((ArrayImmutableSet<?>) targets).elements) {
-        if (!contains(target)) {
-          return false;
-        }
-      }
-      return true;
-    }
-  }
-
-  private static final class RegularImmutableSet<E>
-      extends ArrayImmutableSet<E> {
-    final Object[] table; // the same elements in hashed positions (plus nulls)
-    final int mask; // 'and' with an int to get a valid table index
-    final int hashCode;
-
-    RegularImmutableSet(Object[] elements, int hashCode,
-        Object[] table, int mask) {
-      super(elements);
-      this.table = table;
-      this.mask = mask;
-      this.hashCode = hashCode;
-    }
-
-    @Override public boolean contains(Object target) {
-      if (target == null) {
-        return false;
-      }
-      for (int i = Hashing.smear(target.hashCode()); true; i++) {
-        Object candidate = table[i & mask];
-        if (candidate == null) {
-          return false;
-        }
-        if (candidate.equals(target)) {
-          return true;
-        }
-      }
-    }
-
-    @Override public int hashCode() {
-      return hashCode;
-    }
-
-    @Override boolean isHashCodeFast() {
-      return true;
-    }
-  }
-
-  /** such as ImmutableMap.keySet() */
-  abstract static class TransformedImmutableSet<D, E> extends ImmutableSet<E> {
-    final D[] source;
-    final int hashCode;
-
-    TransformedImmutableSet(D[] source, int hashCode) {
-      this.source = source;
-      this.hashCode = hashCode;
-    }
-
-    abstract E transform(D element);
-
-    public int size() {
-      return source.length;
-    }
-
-    @Override public boolean isEmpty() {
-      return false;
-    }
-
-    @Override public UnmodifiableIterator<E> iterator() {
-      Iterator<E> iterator = new AbstractIterator<E>() {
-        int index = 0;
-        @Override protected E computeNext() {
-          return index < source.length
-              ? transform(source[index++])
-              : endOfData();
-        }
-      };
-      // Though the AbstractIterator is unmodifiable, it isn't an
-      // UnmodifiableIterator.
-      return Iterators.unmodifiableIterator(iterator);
-    }
-
-    @Override public Object[] toArray() {
-      return toArray(new Object[size()]);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override public <T> T[] toArray(T[] array) {
-      int size = size();
-      if (array.length < size) {
-        array = ObjectArrays.newArray(array, size);
-      } else if (array.length > size) {
-        array[size] = null;
-      }
-
-      for (int i = 0; i < source.length; i++) {
-        array[i] = (T) transform(source[i]);
-      }
-      return array;
-    }
-
-    @Override public final int hashCode() {
-      return hashCode;
-    }
-
-    @Override boolean isHashCodeFast() {
-      return true;
-    }
-  }
-
-  /*
-   * This class is used to serialize all ImmutableSet instances, regardless of
-   * implementation type. It captures their "logical contents" and they are
-   * reconstructed using public static factories. This is necessary to ensure
-   * that the existence of a particular implementation type is an implementation
-   * detail.
-   */
-  private static class SerializedForm implements Serializable {
-    final Object[] elements;
-    SerializedForm(Object[] elements) {
-      this.elements = elements;
-    }
-    Object readResolve() {
-      return of(elements);
-    }
-    private static final long serialVersionUID = 0;
-  }
-
-  @Override Object writeReplace() {
-    return new SerializedForm(toArray());
-  }
-
-  /**
-   * Returns a new builder. The generated builder is equivalent to the builder
-   * created by the {@link Builder} constructor.
-   */
-  public static <E> Builder<E> builder() {
-    return new Builder<E>();
-  }
-
-  /**
-   * A builder for creating immutable set instances, especially
-   * {@code public static final} sets ("constant sets").
-   *
-   * <p>Example:
-   * <pre>{@code
-   *   public static final ImmutableSet<Color> GOOGLE_COLORS
-   *       = new ImmutableSet.Builder<Color>()
-   *           .addAll(WEBSAFE_COLORS)
-   *           .add(new Color(0, 191, 255))
-   *           .build();}</pre>
-   *
-   * <p>Builder instances can be reused - it is safe to call {@link #build}
-   * multiple times to build multiple sets in series. Each set
-   * is a superset of the set created before it.
-   */
-  public static class Builder<E> {
-    final ArrayList<E> contents = Lists.newArrayList();
-
-    /**
-     * Creates a new builder. The returned builder is equivalent to the builder
-     * generated by {@link ImmutableSet#builder}.
-     */
-    public Builder() {}
-
-    /**
-     * Adds {@code element} to the {@code ImmutableSet}.  If the
-     * {@code ImmutableSet} already contains {@code element}, then
-     * {@code add} has no effect. (only the previously added element
-     * is retained).
-     *
-     * @param element the element to add
-     * @return this {@code Builder} object
-     * @throws NullPointerException if {@code element} is null
-     */
-    public Builder<E> add(E element) {
-      Preconditions.checkNotNull(element, "element cannot be null");
-      contents.add(element);
-      return this;
-    }
-
-    /**
-     * Adds each element of {@code elements} to the {@code ImmutableSet},
-     * ignoring duplicate elements (only the first duplicate element is added).
-     *
-     * @param elements the elements to add
-     * @return this {@code Builder} object
-     * @throws NullPointerException if {@code elements} is or contains null
-     */
-    public Builder<E> add(E... elements) {
-      Preconditions.checkNotNull(elements, "elements cannot be null");
-      List<E> elemsAsList = Arrays.asList(elements);
-      Preconditions.checkContentsNotNull(elemsAsList,
-          "elements cannot contain null");
-      contents.addAll(elemsAsList);
-      return this;
-    }
-
-    /**
-     * Adds each element of {@code elements} to the {@code ImmutableSet},
-     * ignoring duplicate elements (only the first duplicate element is added).
-     *
-     * @param elements the {@code Iterable} to add to the {@code ImmutableSet}
-     * @return this {@code Builder} object
-     * @throws NullPointerException if {@code elements} is or contains null
-     */
-    public Builder<E> addAll(Iterable<? extends E> elements) {
-      if (elements instanceof Collection) {
-        @SuppressWarnings("unchecked")
-        Collection<? extends E> collection = (Collection<? extends E>) elements;
-        contents.ensureCapacity(contents.size() + collection.size());
-      }
-      for (E elem : elements) {
-        Preconditions.checkNotNull(elem, "elements contains a null");
-        contents.add(elem);
-      }
-      return this;
-    }
-
-    /**
-     * Adds each element of {@code elements} to the {@code ImmutableSet},
-     * ignoring duplicate elements (only the first duplicate element is added).
-     *
-     * @param elements the elements to add to the {@code ImmutableSet}
-     * @return this {@code Builder} object
-     * @throws NullPointerException if {@code elements} is or contains null
-     */
-    public Builder<E> addAll(Iterator<? extends E> elements) {
-      while (elements.hasNext()) {
-        E element = elements.next();
-        Preconditions.checkNotNull(element, "element cannot be null");
-        contents.add(element);
-      }
-      return this;
-    }
-
-    /**
-     * Returns a newly-created {@code ImmutableSet} based on the contents of
-     * the {@code Builder}.
-     */
-    public ImmutableSet<E> build() {
-      return copyOf(contents);
-    }
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Iterables.java b/core/src/com/google/inject/internal/util/Iterables.java
deleted file mode 100644
index ab2835d..0000000
--- a/core/src/com/google/inject/internal/util/Iterables.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class contains static utility methods that operate on or return objects
- * of type {@code Iterable}. Also see the parallel implementations in {@link
- * Iterators}.
- *
- * @author Kevin Bourrillion
- * @author Scott Bonneau
- */
-public final class Iterables {
-  private Iterables() {}
-
-  /**
-   * Returns a string representation of {@code iterable}, with the format
-   * {@code [e1, e2, ..., en]}.
-   */
-  public static String toString(Iterable<?> iterable) {
-    return Iterators.toString(iterable.iterator());
-  }
-
-  /**
-   * Returns the single element contained in {@code iterable}.
-   *
-   * @throws NoSuchElementException if the iterable is empty
-   * @throws IllegalArgumentException if the iterable contains multiple
-   *     elements
-   */
-  public static <T> T getOnlyElement(Iterable<T> iterable) {
-    return Iterators.getOnlyElement(iterable.iterator());
-  }
-
-  /**
-   * Combines two iterables into a single iterable. The returned iterable has an
-   * iterator that traverses the elements in {@code a}, followed by the elements
-   * in {@code b}. The source iterators are not polled until necessary.
-   *
-   * <p>The returned iterable's iterator supports {@code remove()} when the
-   * corresponding input iterator supports it.
-   */
-  @SuppressWarnings("unchecked")
-  public static <T> Iterable<T> concat(
-      Iterable<? extends T> a, Iterable<? extends T> b) {
-    Preconditions.checkNotNull(a);
-    Preconditions.checkNotNull(b);
-    return concat(Arrays.asList(a, b));
-  }
-
-  /**
-   * Combines multiple iterables into a single iterable. The returned iterable
-   * has an iterator that traverses the elements of each iterable in
-   * {@code inputs}. The input iterators are not polled until necessary.
-   *
-   * <p>The returned iterable's iterator supports {@code remove()} when the
-   * corresponding input iterator supports it. The methods of the returned
-   * iterable may throw {@code NullPointerException} if any of the input
-   * iterators are null.
-   */
-  public static <T> Iterable<T> concat(
-      Iterable<? extends Iterable<? extends T>> inputs) {
-    /*
-     * Hint: if you let A represent Iterable<? extends T> and B represent
-     * Iterator<? extends T>, then this Function would look simply like:
-     *
-     *   Function<A, B> function = new Function<A, B> {
-     *     public B apply(A from) {
-     *       return from.iterator();
-     *     }
-     *   }
-     *
-     * TODO: there may be a better way to do this.
-     */
-
-    Function<Iterable<? extends T>, Iterator<? extends T>> function
-        = new Function<Iterable<? extends T>, Iterator<? extends T>>() {
-      public Iterator<? extends T> apply(Iterable<? extends T> from) {
-        return from.iterator();
-      }
-    };
-    final Iterable<Iterator<? extends T>> iterators
-        = transform(inputs, function);
-    return new IterableWithToString<T>() {
-      public Iterator<T> iterator() {
-        return Iterators.concat(iterators.iterator());
-      }
-    };
-  }
-
-  /**
-   * Returns an iterable that applies {@code function} to each element of {@code
-   * fromIterable}.
-   *
-   * <p>The returned iterable's iterator supports {@code remove()} if the
-   * provided iterator does. After a successful {@code remove()} call,
-   * {@code fromIterable} no longer contains the corresponding element.
-   */
-  public static <F, T> Iterable<T> transform(final Iterable<F> fromIterable,
-      final Function<? super F, ? extends T> function) {
-    Preconditions.checkNotNull(fromIterable);
-    Preconditions.checkNotNull(function);
-    return new IterableWithToString<T>() {
-      public Iterator<T> iterator() {
-        return Iterators.transform(fromIterable.iterator(), function);
-      }
-    };
-  }
-
-  // Methods only in Iterables, not in Iterators
-
-  abstract static class IterableWithToString<E> implements Iterable<E> {
-    @Override public String toString() {
-      return Iterables.toString(this);
-    }
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Iterators.java b/core/src/com/google/inject/internal/util/Iterators.java
deleted file mode 100644
index 7706feb..0000000
--- a/core/src/com/google/inject/internal/util/Iterators.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class contains static utility methods that operate on or return objects
- * of type {@code Iterator}. Also see the parallel implementations in {@link
- * Iterables}.
- *
- * @author Kevin Bourrillion
- * @author Scott Bonneau
- */
-public final class Iterators {
-  private Iterators() {}
-
-  static final Iterator<Object> EMPTY_ITERATOR
-      = new UnmodifiableIterator<Object>() {
-        public boolean hasNext() {
-          return false;
-        }
-        public Object next() {
-          throw new NoSuchElementException();
-        }
-      };
-
-
-  /** Returns the empty {@code Iterator}. */
-  // Casting to any type is safe since there are no actual elements.
-  @SuppressWarnings("unchecked")
-  public static <T> UnmodifiableIterator<T> emptyIterator() {
-    return (UnmodifiableIterator<T>) EMPTY_ITERATOR;
-  }
-
-  private static final ListIterator<Object> EMPTY_LIST_ITERATOR =
-      new ListIterator<Object>() {
-        public boolean hasNext() {
-          return false;
-        }
-        public boolean hasPrevious() {
-          return false;
-        }
-        public int nextIndex() {
-          return 0;
-        }
-        public int previousIndex() {
-          return -1;
-        }
-        public Object next() {
-          throw new NoSuchElementException();
-        }
-        public Object previous() {
-          throw new NoSuchElementException();
-        }
-        public void set(Object o) {
-          throw new UnsupportedOperationException();
-        }
-        public void add(Object o) {
-          throw new UnsupportedOperationException();
-        }
-        public void remove() {
-          throw new UnsupportedOperationException();
-        }
-      };
-
-  /** Returns the empty {@code ListIterator}. */
-  // Casting to any type is safe since there are no actual elements.
-  @SuppressWarnings("unchecked")
-  public static <T> ListIterator<T> emptyListIterator() {
-    return (ListIterator<T>) EMPTY_LIST_ITERATOR;
-  }
-
-  /** Returns an unmodifiable view of {@code iterator}. */
-  public static <T> UnmodifiableIterator<T> unmodifiableIterator(
-      final Iterator<T> iterator) {
-    Preconditions.checkNotNull(iterator);
-    return new UnmodifiableIterator<T>() {
-      public boolean hasNext() {
-        return iterator.hasNext();
-      }
-      public T next() {
-        return iterator.next();
-      }
-    };
-  }
-
-
-  /**
-   * Returns a string representation of {@code iterator}, with the format
-   * {@code [e1, e2, ..., en]}. The iterator will be left exhausted: its
-   * {@code hasNext()} method will return {@code false}.
-   */
-  public static String toString(Iterator<?> iterator) {
-    if (!iterator.hasNext()) {
-      return "[]";
-    }
-    StringBuilder builder = new StringBuilder();
-    builder.append('[').append(iterator.next());
-    while (iterator.hasNext()) {
-      builder.append(", ").append(iterator.next());
-    }
-    return builder.append(']').toString();
-  }
-
-  /**
-   * Returns the single element contained in {@code iterator}.
-   *
-   * @throws NoSuchElementException if the iterator is empty
-   * @throws IllegalArgumentException if the iterator contains multiple
-   *     elements.  The state of the iterator is unspecified.
-   */
-  public static <T> T getOnlyElement(Iterator<T> iterator) {
-    T first = iterator.next();
-    if (!iterator.hasNext()) {
-      return first;
-    }
-
-    StringBuilder sb = new StringBuilder();
-    sb.append("expected one element but was: <" + first);
-    for (int i = 0; i < 4 && iterator.hasNext(); i++) {
-      sb.append(", " + iterator.next());
-    }
-    if (iterator.hasNext()) {
-      sb.append(", ...");
-    }
-    sb.append(">");
-
-    throw new IllegalArgumentException(sb.toString());
-  }
-
-  /**
-   * Combines multiple iterators into a single iterator. The returned iterator
-   * iterates across the elements of each iterator in {@code inputs}. The input
-   * iterators are not polled until necessary.
-   *
-   * <p>The returned iterator supports {@code remove()} when the corresponding
-   * input iterator supports it. The methods of the returned iterator may throw
-   * {@code NullPointerException} if any of the input iterators are null.
-   */
-  public static <T> Iterator<T> concat(
-      final Iterator<? extends Iterator<? extends T>> inputs) {
-    Preconditions.checkNotNull(inputs);
-    return new Iterator<T>() {
-      Iterator<? extends T> current = emptyIterator();
-      Iterator<? extends T> removeFrom;
-
-      public boolean hasNext() {
-        while (!current.hasNext() && inputs.hasNext()) {
-          current = inputs.next();
-        }
-        return current.hasNext();
-      }
-      public T next() {
-        if (!hasNext()) {
-          throw new NoSuchElementException();
-        }
-        removeFrom = current;
-        return current.next();
-      }
-      public void remove() {
-        Preconditions.checkState(removeFrom != null,
-            "no calls to next() since last call to remove()");
-        removeFrom.remove();
-        removeFrom = null;
-      }
-    };
-  }
-
-
-  /**
-   * Returns an iterator that applies {@code function} to each element of {@code
-   * fromIterator}.
-   *
-   * <p>The returned iterator supports {@code remove()} if the provided iterator
-   * does. After a successful {@code remove()} call, {@code fromIterator} no
-   * longer contains the corresponding element.
-   */
-  public static <F, T> Iterator<T> transform(final Iterator<F> fromIterator,
-      final Function<? super F, ? extends T> function) {
-    Preconditions.checkNotNull(fromIterator);
-    Preconditions.checkNotNull(function);
-    return new Iterator<T>() {
-      public boolean hasNext() {
-        return fromIterator.hasNext();
-      }
-      public T next() {
-        F from = fromIterator.next();
-        return function.apply(from);
-      }
-      public void remove() {
-        fromIterator.remove();
-      }
-    };
-  }
-
-  // Methods only in Iterators, not in Iterables
-
-  /**
-   * Returns an iterator containing the elements of {@code array} in order. The
-   * returned iterator is a view of the array; subsequent changes to the array
-   * will be reflected in the iterator.
-   *
-   * <p><b>Note:</b> It is often preferable to represent your data using a
-   * collection type, for example using {@link Arrays#asList(Object[])}, making
-   * this method unnecessary.
-   */
-  public static <T> UnmodifiableIterator<T> forArray(final T... array) {
-    // optimized. benchmarks at nearly 2x of the straightforward impl
-    return new UnmodifiableIterator<T>() {
-      final int length = array.length;
-      int i = 0;
-      public boolean hasNext() {
-        return i < length;
-      }
-      public T next() {
-        try {
-          // 'return array[i++];' almost works
-          T t = array[i];
-          i++;
-          return t;
-        } catch (ArrayIndexOutOfBoundsException e) {
-          throw new NoSuchElementException();
-        }
-      }
-    };
-  }
-
-  /**
-   * Returns an iterator containing the elements in the specified range of
-   * {@code array} in order. The returned iterator is a view of the array;
-   * subsequent changes to the array will be reflected in the iterator.
-   *
-   * @param array array to read elements out of
-   * @param offset index of first array element to retrieve
-   * @param length number of elements in iteration
-   *
-   * @throws IndexOutOfBoundsException if {@code offset} is negative,
-   *    {@code length} is negative, or {@code offset + length > array.length}
-   */
-  public static <T> UnmodifiableIterator<T> forArray(
-      final T[] array, final int offset, final int length) {
-    Preconditions.checkArgument(length >= 0);
-    final int end = offset + length;
-
-    // Technically we should give a slightly more descriptive error on overflow
-    Preconditions.checkPositionIndexes(offset, end, array.length);
-
-    // If length == 0 is a common enough case, we could return emptyIterator().
-
-    return new UnmodifiableIterator<T>() {
-      int i = offset;
-      public boolean hasNext() {
-        return i < end;
-      }
-      public T next() {
-        if (!hasNext()) {
-          throw new NoSuchElementException();
-        }
-        return array[i++];
-      }
-    };
-  }
-
-  /**
-   * Returns an iterator containing only {@code value}.
-   */
-  public static <T> UnmodifiableIterator<T> singletonIterator(
-      @Nullable final T value) {
-    return new UnmodifiableIterator<T>() {
-      boolean done;
-      public boolean hasNext() {
-        return !done;
-      }
-      public T next() {
-        if (done) {
-          throw new NoSuchElementException();
-        }
-        done = true;
-        return value;
-      }
-    };
-  }
-
-  /**
-   * Adapts an {@code Iterator} to the {@code Enumeration} interface.
-   *
-   * @see Collections#enumeration(Collection)
-   */
-  public static <T> Enumeration<T> asEnumeration(final Iterator<T> iterator) {
-    Preconditions.checkNotNull(iterator);
-    return new Enumeration<T>() {
-      public boolean hasMoreElements() {
-        return iterator.hasNext();
-      }
-      public T nextElement() {
-        return iterator.next();
-      }
-    };
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Join.java b/core/src/com/google/inject/internal/util/Join.java
deleted file mode 100644
index 4e5c04f..0000000
--- a/core/src/com/google/inject/internal/util/Join.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Utility for joining pieces of text separated by a delimiter. It can handle
- * iterators, collections, arrays, and varargs, and can append to any
- * {@link Appendable} or just return a {@link String}. For example,
- * {@code join(":", "a", "b", "c")} returns {@code "a:b:c"}.
- *
- * <p>All methods of this class throw {@link NullPointerException} when a value
- * of {@code null} is supplied for any parameter. The elements within the
- * collection, iterator, array, or varargs parameter list <i>may</i> be null --
- * these will be represented in the output by the string {@code "null"}.
- *
- * @author Kevin Bourrillion
- */
-public final class Join {
-  private Join() {}
-
-  /**
-   * Returns a string containing the {@code tokens}, converted to strings if
-   * necessary, separated by {@code delimiter}. If {@code tokens} is empty, it
-   * returns an empty string.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param tokens objects to append
-   * @return a string consisting of the joined elements
-   */
-  public static String join(String delimiter, Iterable<?> tokens) {
-    return join(delimiter, tokens.iterator());
-  }
-
-  /**
-   * Returns a string containing the {@code tokens}, converted to strings if
-   * necessary, separated by {@code delimiter}. If {@code tokens} is empty, it
-   * returns an empty string.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param tokens objects to append
-   * @return a string consisting of the joined elements
-   */
-  public static String join(String delimiter, Object[] tokens) {
-    return join(delimiter, Arrays.asList(tokens));
-  }
-
-  /**
-   * Returns a string containing the {@code tokens}, converted to strings if
-   * necessary, separated by {@code delimiter}.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param firstToken the first object to append
-   * @param otherTokens subsequent objects to append
-   * @return a string consisting of the joined elements
-   */
-  public static String join(
-      String delimiter, @Nullable Object firstToken, Object... otherTokens) {
-    Preconditions.checkNotNull(otherTokens);
-    return join(delimiter, Lists.newArrayList(firstToken, otherTokens));
-  }
-
-  /**
-   * Returns a string containing the {@code tokens}, converted to strings if
-   * necessary, separated by {@code delimiter}. If {@code tokens} is empty, it
-   * returns an empty string.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param tokens objects to append
-   * @return a string consisting of the joined elements
-   */
-  public static String join(String delimiter, Iterator<?> tokens) {
-    StringBuilder sb = new StringBuilder();
-    join(sb, delimiter, tokens);
-    return sb.toString();
-  }
-
-  /**
-   * Returns a string containing the contents of {@code map}, with entries
-   * separated by {@code entryDelimiter}, and keys and values separated with
-   * {@code keyValueSeparator}.
-   *
-   * <p>Each key and value will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param keyValueSeparator a string to append between every key and its
-   *     associated value
-   * @param entryDelimiter a string to append between every entry, but not at
-   *     the beginning or end
-   * @param map the map containing the data to join
-   * @return a string consisting of the joined entries of the map; empty if the
-   *     map is empty
-   */
-  public static String join(
-      String keyValueSeparator, String entryDelimiter, Map<?, ?> map) {
-    return join(new StringBuilder(), keyValueSeparator, entryDelimiter, map)
-        .toString();
-  }
-
-  /**
-   * Appends each of the {@code tokens} to {@code appendable}, separated by
-   * {@code delimiter}.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param appendable the object to append the results to
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param tokens objects to append
-   * @return the same {@code Appendable} instance that was passed in
-   * @throws JoinException if an {@link IOException} occurs
-   */
-  public static <T extends Appendable> T join(
-      T appendable, String delimiter, Iterable<?> tokens) {
-    return join(appendable, delimiter, tokens.iterator());
-  }
-
-  /**
-   * Appends each of the {@code tokens} to {@code appendable}, separated by
-   * {@code delimiter}.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param appendable the object to append the results to
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param tokens objects to append
-   * @return the same {@code Appendable} instance that was passed in
-   * @throws JoinException if an {@link IOException} occurs
-   */
-  public static <T extends Appendable> T join(
-      T appendable, String delimiter, Object[] tokens) {
-    return join(appendable, delimiter, Arrays.asList(tokens));
-  }
-
-  /**
-   * Appends each of the {@code tokens} to {@code appendable}, separated by
-   * {@code delimiter}.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param appendable the object to append the results to
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param firstToken the first object to append
-   * @param otherTokens subsequent objects to append
-   * @return the same {@code Appendable} instance that was passed in
-   * @throws JoinException if an {@link IOException} occurs
-   */
-  public static <T extends Appendable> T join(T appendable, String delimiter,
-      @Nullable Object firstToken, Object... otherTokens) {
-    Preconditions.checkNotNull(otherTokens);
-    return join(appendable, delimiter, Lists.newArrayList(firstToken, otherTokens));
-  }
-
-  /**
-   * Appends each of the {@code tokens} to {@code appendable}, separated by
-   * {@code delimiter}.
-   *
-   * <p>Each token will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param appendable the object to append the results to
-   * @param delimiter a string to append between every element, but not at the
-   *     beginning or end
-   * @param tokens objects to append
-   * @return the same {@code Appendable} instance that was passed in
-   * @throws JoinException if an {@link IOException} occurs
-   */
-  public static <T extends Appendable> T join(
-      T appendable, String delimiter, Iterator<?> tokens) {
-
-    /* This method is the workhorse of the class */
-
-    Preconditions.checkNotNull(appendable);
-    Preconditions.checkNotNull(delimiter);
-    if (tokens.hasNext()) {
-      try {
-        appendOneToken(appendable, tokens.next());
-        while (tokens.hasNext()) {
-          appendable.append(delimiter);
-          appendOneToken(appendable, tokens.next());
-        }
-      } catch (IOException e) {
-        throw new JoinException(e);
-      }
-    }
-    return appendable;
-  }
-
-  /**
-   * Appends the contents of {@code map} to {@code appendable}, with entries
-   * separated by {@code entryDelimiter}, and keys and values separated with
-   * {@code keyValueSeparator}.
-   *
-   * <p>Each key and value will be converted to a {@link CharSequence} using
-   * {@link String#valueOf(Object)}, if it isn't a {@link CharSequence} already.
-   * Note that this implies that null tokens will be appended as the
-   * four-character string {@code "null"}.
-   *
-   * @param appendable the object to append the results to
-   * @param keyValueSeparator a string to append between every key and its
-   *     associated value
-   * @param entryDelimiter a string to append between every entry, but not at
-   *     the beginning or end
-   * @param map the map containing the data to join
-   * @return the same {@code Appendable} instance that was passed in
-   */
-  public static <T extends Appendable> T join(T appendable,
-      String keyValueSeparator, String entryDelimiter, Map<?, ?> map) {
-    Preconditions.checkNotNull(appendable);
-    Preconditions.checkNotNull(keyValueSeparator);
-    Preconditions.checkNotNull(entryDelimiter);
-    Iterator<? extends Map.Entry<?, ?>> entries = map.entrySet().iterator();
-    if (entries.hasNext()) {
-      try {
-        appendOneEntry(appendable, keyValueSeparator, entries.next());
-        while (entries.hasNext()) {
-          appendable.append(entryDelimiter);
-          appendOneEntry(appendable, keyValueSeparator, entries.next());
-        }
-      } catch (IOException e) {
-        throw new JoinException(e);
-      }
-    }
-    return appendable;
-  }
-
-  private static void appendOneEntry(
-      Appendable appendable, String keyValueSeparator, Map.Entry<?, ?> entry)
-      throws IOException {
-    appendOneToken(appendable, entry.getKey());
-    appendable.append(keyValueSeparator);
-    appendOneToken(appendable, entry.getValue());
-  }
-
-  private static void appendOneToken(Appendable appendable, Object token)
-      throws IOException {
-    appendable.append(toCharSequence(token));
-  }
-
-  private static CharSequence toCharSequence(Object token) {
-    return (token instanceof CharSequence)
-        ? (CharSequence) token
-        : String.valueOf(token);
-  }
-
-  /**
-   * Exception thrown in response to an {@link IOException} from the supplied
-   * {@link Appendable}. This is used because most callers won't want to
-   * worry about catching an IOException.
-   */
-  public static class JoinException extends RuntimeException {
-    private JoinException(IOException cause) {
-      super(cause);
-    }
-
-    private static final long serialVersionUID = 1L;
-  }
-}
\ No newline at end of file
diff --git a/core/src/com/google/inject/internal/util/LineNumbers.java b/core/src/com/google/inject/internal/util/LineNumbers.java
index 91bf389..36ef21a 100644
--- a/core/src/com/google/inject/internal/util/LineNumbers.java
+++ b/core/src/com/google/inject/internal/util/LineNumbers.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.internal.util;
 
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -34,6 +34,9 @@
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+
 /**
  * Looks up line numbers for classes and their members.
  *
diff --git a/core/src/com/google/inject/internal/util/Lists.java b/core/src/com/google/inject/internal/util/Lists.java
deleted file mode 100644
index 162e5db..0000000
--- a/core/src/com/google/inject/internal/util/Lists.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Static utility methods pertaining to {@link List} instances. Also see this
- * class's counterparts {@link Sets} and {@link Maps}.
- *
- * @author Kevin Bourrillion
- * @author Mike Bostock
- */
-public final class Lists {
-  private Lists() {}
-
-  // ArrayList
-
-  /**
-   * Creates an empty {@code ArrayList} instance.
-   *
-   * <p><b>Note:</b> if you need an immutable empty list, use {@link
-   * Collections#emptyList} instead.
-   *
-   * @return a new, empty {@code ArrayList}
-   */
-  public static <E> ArrayList<E> newArrayList() {
-    return new ArrayList<E>();
-  }
-
-  /**
-   * Creates an {@code ArrayList} instance containing the given elements.
-   *
-   * <p><b>Note:</b> if you need an immutable List, use {@link ImmutableList}
-   * instead.
-   *
-   * <p><b>Note:</b> due to a bug in javac 1.5.0_06, we cannot support the
-   * following:
-   *
-   * <p>{@code List<Base> list = Lists.newArrayList(sub1, sub2);}
-   *
-   * <p>where {@code sub1} and {@code sub2} are references to subtypes of {@code
-   * Base}, not of {@code Base} itself. To get around this, you must use:
-   *
-   * <p>{@code List<Base> list = Lists.<Base>newArrayList(sub1, sub2);}
-   *
-   * @param elements the elements that the list should contain, in order
-   * @return a new {@code ArrayList} containing those elements
-   */
-  public static <E> ArrayList<E> newArrayList(E... elements) {
-    // Avoid integer overflow when a large array is passed in
-    int capacity = computeArrayListCapacity(elements.length);
-    ArrayList<E> list = new ArrayList<E>(capacity);
-    Collections.addAll(list, elements);
-    return list;
-  }
-
-  static int computeArrayListCapacity(int arraySize) {
-    Preconditions.checkArgument(arraySize >= 0);
-
-    // TODO: Figure out the right behavior, and document it
-    return (int) Math.min(5L + arraySize + (arraySize / 10), Integer.MAX_VALUE);
-  }
-
-  /**
-   * Creates an {@code ArrayList} instance containing the given elements.
-   *
-   * @param elements the elements that the list should contain, in order
-   * @return a new {@code ArrayList} containing those elements
-   */
-  public static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements) {
-    // Let ArrayList's sizing logic work, if possible
-    if (elements instanceof Collection) {
-      @SuppressWarnings("unchecked")
-      Collection<? extends E> collection = (Collection<? extends E>) elements;
-      return new ArrayList<E>(collection);
-    } else {
-      return newArrayList(elements.iterator());
-    }
-  }
-
-  /**
-   * Creates an {@code ArrayList} instance containing the given elements.
-   *
-   * @param elements the elements that the list should contain, in order
-   * @return a new {@code ArrayList} containing those elements
-   */
-  public static <E> ArrayList<E> newArrayList(Iterator<? extends E> elements) {
-    ArrayList<E> list = newArrayList();
-    while (elements.hasNext()) {
-      list.add(elements.next());
-    }
-    return list;
-  }
-
-
-  /**
-   * Returns an unmodifiable list containing the specified first element and
-   * the additional elements.
-   */
-  public static <E> ArrayList<E> newArrayList(@Nullable E first, E[] rest) {
-    ArrayList<E> result = new ArrayList<E>(rest.length + 1);
-    result.add(first);
-    for (E element : rest) {
-      result.add(element);
-    }
-    return result;
-  }
-}
\ No newline at end of file
diff --git a/core/src/com/google/inject/internal/util/MapMaker.java b/core/src/com/google/inject/internal/util/MapMaker.java
deleted file mode 100644
index 284337c..0000000
--- a/core/src/com/google/inject/internal/util/MapMaker.java
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import com.google.inject.internal.util.CustomConcurrentHashMap.ComputingStrategy;
-import com.google.inject.internal.util.CustomConcurrentHashMap.Internals;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.ref.SoftReference;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.TimerTask;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.TimeUnit;
-
-/**
- * A {@link ConcurrentMap} builder, providing any combination of these
- * features: {@linkplain SoftReference soft} or {@linkplain WeakReference
- * weak} keys, soft or weak values, timed expiration, and on-demand
- * computation of values. Usage example: <pre> {@code
- *
- *   ConcurrentMap<Key, Graph> graphs = new MapMaker()
- *       .concurrencyLevel(32)
- *       .softKeys()
- *       .weakValues()
- *       .expiration(30, TimeUnit.MINUTES)
- *       .makeComputingMap(
- *           new Function<Key, Graph>() {
- *             public Graph apply(Key key) {
- *               return createExpensiveGraph(key);
- *             }
- *           });}</pre>
- *
- * These features are all optional; {@code new MapMaker().makeMap()}
- * returns a valid concurrent map that behaves exactly like a
- * {@link ConcurrentHashMap}.
- *
- * The returned map is implemented as a hash table with similar performance
- * characteristics to {@link ConcurrentHashMap}. It supports all optional
- * operations of the {@code ConcurrentMap} interface. It does not permit
- * null keys or values. It is serializable; however, serializing a map that
- * uses soft or weak references can give unpredictable results.
- *
- * <p><b>Note:</b> by default, the returned map uses equality comparisons
- * (the {@link Object#equals(Object) equals} method) to determine equality
- * for keys or values. However, if {@link #weakKeys()} or {@link
- * #softKeys()} was specified, the map uses identity ({@code ==})
- * comparisons instead for keys. Likewise, if {@link #weakValues()} or
- * {@link #softValues()} was specified, the map uses identity comparisons
- * for values.
- *
- * <p>The returned map has <i>weakly consistent iteration</i>: an iterator
- * over one of the map's view collections may reflect some, all or none of
- * the changes made to the map after the iterator was created.
- *
- * <p>An entry whose key or value is reclaimed by the garbage collector
- * immediately disappears from the map. (If the default settings of strong
- * keys and strong values are used, this will never happen.) The client can
- * never observe a partially-reclaimed entry. Any {@link java.util.Map.Entry}
- * instance retrieved from the map's {@linkplain Map#entrySet() entry set}
- * is snapshot of that entry's state at the time of retrieval.
- *
- * <p>{@code new MapMaker().weakKeys().makeMap()} can almost always be
- * used as a drop-in replacement for {@link java.util.WeakHashMap}, adding
- * concurrency, asynchronous cleanup, identity-based equality for keys, and
- * great flexibility.
- *
- * @author Bob Lee
- * @author Kevin Bourrillion
- */
-public final class MapMaker {
-  private Strength keyStrength = Strength.STRONG;
-  private Strength valueStrength = Strength.STRONG;
-  private long expirationNanos = 0;
-  private boolean useCustomMap;
-  private final CustomConcurrentHashMap.Builder builder
-      = new CustomConcurrentHashMap.Builder();
-
-  /**
-   * Constructs a new {@code MapMaker} instance with default settings,
-   * including strong keys, strong values, and no automatic expiration.
-   */
-  public MapMaker() {}
-
-  /**
-   * Sets a custom initial capacity (defaults to 16). Resizing this or
-   * any other kind of hash table is a relatively slow operation, so,
-   * when possible, it is a good idea to provide estimates of expected
-   * table sizes.
-   *
-   * @throws IllegalArgumentException if {@code initialCapacity} is
-   *   negative
-   * @throws IllegalStateException if an initial capacity was already set
-   *     (TODO: make that true)
-   */
-  public MapMaker initialCapacity(int initialCapacity) {
-    builder.initialCapacity(initialCapacity);
-    return this;
-  }
-
-  /**
-   * Sets a custom load factor (defaults to 0.75).
-   *
-   * @throws IllegalArgumentException if {@code loadFactor} is
-   *     nonpositive
-   * @throws IllegalStateException if a load factor was already set
-   *     (TODO: make that true)
-   */
-  public MapMaker loadFactor(float loadFactor) {
-    builder.loadFactor(loadFactor);
-    return this;
-  }
-
-  /**
-   * Guides the allowed concurrency among update operations. Used as a
-   * hint for internal sizing. The table is internally partitioned to try
-   * to permit the indicated number of concurrent updates without
-   * contention.  Because placement in hash tables is essentially random,
-   * the actual concurrency will vary. Ideally, you should choose a value
-   * to accommodate as many threads as will ever concurrently modify the
-   * table. Using a significantly higher value than you need can waste
-   * space and time, and a significantly lower value can lead to thread
-   * contention. But overestimates and underestimates within an order of
-   * magnitude do not usually have much noticeable impact. A value of one
-   * is appropriate when it is known that only one thread will modify and
-   * all others will only read. Defaults to 16.
-   *
-   * @throws IllegalArgumentException if {@code concurrencyLevel} is
-   *     nonpositive
-   * @throws IllegalStateException if a concurrency level was already set
-   *     (TODO: make that true)
-   */
-  public MapMaker concurrencyLevel(int concurrencyLevel) {
-    builder.concurrencyLevel(concurrencyLevel);
-    return this;
-  }
-
-  /**
-   * Specifies that each key (not value) stored in the map should be
-   * wrapped in a {@link WeakReference} (by default, strong references
-   * are used).
-   *
-   * @throws IllegalStateException if the key strength was already set
-   */
-  public MapMaker weakKeys() {
-    return setKeyStrength(Strength.WEAK);
-  }
-
-  /**
-   * Specifies that each key (not value) stored in the map should be
-   * wrapped in a {@link SoftReference} (by default, strong references
-   * are used).
-   *
-   * @throws IllegalStateException if the key strength was already set
-   */
-  public MapMaker softKeys() {
-    return setKeyStrength(Strength.SOFT);
-  }
-
-  private MapMaker setKeyStrength(Strength strength) {
-    if (keyStrength != Strength.STRONG) {
-      throw new IllegalStateException("Key strength was already set to "
-          + keyStrength + ".");
-    }
-    keyStrength = strength;
-    useCustomMap = true;
-    return this;
-  }
-
-  /**
-   * Specifies that each value (not key) stored in the map should be
-   * wrapped in a {@link WeakReference} (by default, strong references
-   * are used).
-   *
-   * @throws IllegalStateException if the key strength was already set
-   */
-  public MapMaker weakValues() {
-    return setValueStrength(Strength.WEAK);
-  }
-
-  /**
-   * Specifies that each value (not key) stored in the map should be
-   * wrapped in a {@link SoftReference} (by default, strong references
-   * are used).
-   *
-   * @throws IllegalStateException if the value strength was already set
-   */
-  public MapMaker softValues() {
-    return setValueStrength(Strength.SOFT);
-  }
-
-  private MapMaker setValueStrength(Strength strength) {
-    if (valueStrength != Strength.STRONG) {
-      throw new IllegalStateException("Value strength was already set to "
-          + valueStrength + ".");
-    }
-    valueStrength = strength;
-    useCustomMap = true;
-    return this;
-  }
-
-  /**
-   * Specifies that each entry should be automatically removed from the
-   * map once a fixed duration has passed since the entry's creation.
-   *
-   * @param duration the length of time after an entry is created that it
-   *     should be automatically removed
-   * @param unit the unit that {@code duration} is expressed in
-   * @throws IllegalArgumentException if {@code duration} is not positive
-   * @throws IllegalStateException if the expiration time was already set
-   */
-  public MapMaker expiration(long duration, TimeUnit unit) {
-    if (expirationNanos != 0) {
-      throw new IllegalStateException("expiration time of "
-          + expirationNanos + " ns was already set");
-    }
-    if (duration <= 0) {
-      throw new IllegalArgumentException("invalid duration: " + duration);
-    }
-    this.expirationNanos = unit.toNanos(duration);
-    useCustomMap = true;
-    return this;
-  }
-
-  /**
-   * Builds the final map, without on-demand computation of values.
-   *
-   * @param <K> the type of keys to be stored in the returned map
-   * @param <V> the type of values to be stored in the returned map
-   * @return a concurrent map having the requested features
-   */
-  public <K, V> ConcurrentMap<K, V> makeMap() {
-    return useCustomMap
-        ? new StrategyImpl<K, V>(this).map
-        : new ConcurrentHashMap<K, V>(builder.initialCapacity,
-            builder.loadFactor, builder.concurrencyLevel);
-  }
-
-  /**
-   * Builds a map that supports atomic, on-demand computation of values. {@link
-   * Map#get} returns the value corresponding to the given key, atomically
-   * computes it using the computer function passed to this builder, or waits
-   * for another thread to compute the value if necessary. Only one value will
-   * be computed for each key at a given time.
-   *
-   * <p>If an entry's value has not finished computing yet, query methods
-   * besides {@link java.util.Map#get} return immediately as if an entry doesn't
-   * exist. In other words, an entry isn't externally visible until the value's
-   * computation completes.
-   *
-   * <p>{@link Map#get} in the returned map implementation throws:
-   *
-   * <ul>
-   * <li>{@link NullPointerException} if the key is null or the computer returns
-   *     null</li>
-   * <li>or {@link ComputationException} wrapping an exception thrown by the
-   *     computation</li>
-   * </ul>
-   *
-   * <p><b>Note:</b> Callers of {@code get()} <i>must</i> ensure that the key
-   * argument is of type {@code K}. {@code Map.get()} takes {@code Object}, so
-   * the key type is not checked at compile time. Passing an object of a type
-   * other than {@code K} can result in that object being unsafely passed to the
-   * computer function as type {@code K} not to mention the unsafe key being
-   * stored in the map.
-   *
-   * <p>If {@link java.util.Map#put} is called before a computation completes,
-   * other threads waiting on the computation will wake up and return the put
-   * value up until the computation completes, at which point the computation
-   * result will overwrite the value from the {@code put} in the map.
-   */
-  public <K, V> ConcurrentMap<K, V> makeComputingMap(
-      Function<? super K, ? extends V> computer) {
-    return new StrategyImpl<K, V>(this, computer).map;
-  }
-
-  // Remainder of this file is private implementation details
-
-  private enum Strength {
-    WEAK {
-      boolean equal(Object a, Object b) {
-        return a == b;
-      }
-      int hash(Object o) {
-        return System.identityHashCode(o);
-      }
-      <K, V> ValueReference<K, V> referenceValue(
-          ReferenceEntry<K, V> entry, V value) {
-        return new WeakValueReference<K, V>(value, entry);
-      }
-      <K, V> ReferenceEntry<K, V> newEntry(
-          Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-          int hash, ReferenceEntry<K, V> next) {
-        return (next == null)
-            ? new WeakEntry<K, V>(internals, key, hash)
-            : new LinkedWeakEntry<K, V>(internals, key, hash, next);
-      }
-      <K, V> ReferenceEntry<K, V> copyEntry(
-          K key, ReferenceEntry<K, V> original,
-          ReferenceEntry<K, V> newNext) {
-        WeakEntry<K, V> from = (WeakEntry<K, V>) original;
-        return (newNext == null)
-            ? new WeakEntry<K, V>(from.internals, key, from.hash)
-            : new LinkedWeakEntry<K, V>(
-                from.internals, key, from.hash, newNext);
-      }
-    },
-
-    SOFT {
-      boolean equal(Object a, Object b) {
-        return a == b;
-      }
-      int hash(Object o) {
-        return System.identityHashCode(o);
-      }
-      <K, V> ValueReference<K, V> referenceValue(
-          ReferenceEntry<K, V> entry, V value) {
-        return new SoftValueReference<K, V>(value, entry);
-      }
-      <K, V> ReferenceEntry<K, V> newEntry(
-          Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-          int hash, ReferenceEntry<K, V> next) {
-        return (next == null)
-            ? new SoftEntry<K, V>(internals, key, hash)
-            : new LinkedSoftEntry<K, V>(internals, key, hash, next);
-      }
-      <K, V> ReferenceEntry<K, V> copyEntry(
-          K key, ReferenceEntry<K, V> original,
-          ReferenceEntry<K, V> newNext) {
-        SoftEntry<K, V> from = (SoftEntry<K, V>) original;
-        return (newNext == null)
-            ? new SoftEntry<K, V>(from.internals, key, from.hash)
-            : new LinkedSoftEntry<K, V>(
-                from.internals, key, from.hash, newNext);
-      }
-    },
-
-    STRONG {
-      boolean equal(Object a, Object b) {
-        return a.equals(b);
-      }
-      int hash(Object o) {
-        return o.hashCode();
-      }
-      <K, V> ValueReference<K, V> referenceValue(
-          ReferenceEntry<K, V> entry, V value) {
-        return new StrongValueReference<K, V>(value);
-      }
-      <K, V> ReferenceEntry<K, V> newEntry(
-          Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-          int hash, ReferenceEntry<K, V> next) {
-        return (next == null)
-            ? new StrongEntry<K, V>(internals, key, hash)
-            : new LinkedStrongEntry<K, V>(
-                internals, key, hash, next);
-      }
-      <K, V> ReferenceEntry<K, V> copyEntry(
-          K key, ReferenceEntry<K, V> original,
-          ReferenceEntry<K, V> newNext) {
-        StrongEntry<K, V> from = (StrongEntry<K, V>) original;
-        return (newNext == null)
-            ? new StrongEntry<K, V>(from.internals, key, from.hash)
-            : new LinkedStrongEntry<K, V>(
-                from.internals, key, from.hash, newNext);
-      }
-    };
-
-    /**
-     * Determines if two keys or values are equal according to this
-     * strength strategy.
-     */
-    abstract boolean equal(Object a, Object b);
-
-    /**
-     * Hashes a key according to this strategy.
-     */
-    abstract int hash(Object o);
-
-    /**
-     * Creates a reference for the given value according to this value
-     * strength.
-     */
-    abstract <K, V> ValueReference<K, V> referenceValue(
-        ReferenceEntry<K, V> entry, V value);
-
-    /**
-     * Creates a new entry based on the current key strength.
-     */
-    abstract <K, V> ReferenceEntry<K, V> newEntry(
-        Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-        int hash, ReferenceEntry<K, V> next);
-
-    /**
-     * Creates a new entry and copies the value and other state from an
-     * existing entry.
-     */
-    abstract <K, V> ReferenceEntry<K, V> copyEntry(K key,
-        ReferenceEntry<K, V> original, ReferenceEntry<K, V> newNext);
-  }
-
-  private static class StrategyImpl<K, V> implements Serializable,
-      ComputingStrategy<K, V, ReferenceEntry<K, V>> {
-    final Strength keyStrength;
-    final Strength valueStrength;
-    final ConcurrentMap<K, V> map;
-    final long expirationNanos;
-    Internals<K, V, ReferenceEntry<K, V>> internals;
-
-    StrategyImpl(MapMaker maker) {
-      this.keyStrength = maker.keyStrength;
-      this.valueStrength = maker.valueStrength;
-      this.expirationNanos = maker.expirationNanos;
-
-      map = maker.builder.buildMap(this);
-    }
-
-    StrategyImpl(
-        MapMaker maker, Function<? super K, ? extends V> computer) {
-      this.keyStrength = maker.keyStrength;
-      this.valueStrength = maker.valueStrength;
-      this.expirationNanos = maker.expirationNanos;
-
-      map = maker.builder.buildComputingMap(this, computer);
-    }
-
-    public void setValue(ReferenceEntry<K, V> entry, V value) {
-      setValueReference(
-          entry, valueStrength.referenceValue(entry, value));
-      if (expirationNanos > 0) {
-        scheduleRemoval(entry.getKey(), value);
-      }
-    }
-
-    void scheduleRemoval(K key, V value) {
-      /*
-       * TODO: Keep weak reference to map, too. Build a priority
-       * queue out of the entries themselves instead of creating a
-       * task per entry. Then, we could have one recurring task per
-       * map (which would clean the entire map and then reschedule
-       * itself depending upon when the next expiration comes). We
-       * also want to avoid removing an entry prematurely if the
-       * entry was set to the same value again.
-       */
-      final WeakReference<K> keyReference = new WeakReference<K>(key);
-      final WeakReference<V> valueReference = new WeakReference<V>(value);
-      ExpirationTimer.instance.schedule(
-          new TimerTask() {
-            public void run() {
-              K key = keyReference.get();
-              if (key != null) {
-                // Remove if the value is still the same.
-                map.remove(key, valueReference.get());
-              }
-            }
-          }, TimeUnit.NANOSECONDS.toMillis(expirationNanos));
-    }
-
-    public boolean equalKeys(K a, Object b) {
-      return keyStrength.equal(a, b);
-    }
-
-    public boolean equalValues(V a, Object b) {
-      return valueStrength.equal(a, b);
-    }
-
-    public int hashKey(Object key) {
-      return keyStrength.hash(key);
-    }
-
-    public K getKey(ReferenceEntry<K, V> entry) {
-      return entry.getKey();
-    }
-
-    public int getHash(ReferenceEntry entry) {
-      return entry.getHash();
-    }
-
-    public ReferenceEntry<K, V> newEntry(
-        K key, int hash, ReferenceEntry<K, V> next) {
-      return keyStrength.newEntry(internals, key, hash, next);
-    }
-
-    public ReferenceEntry<K, V> copyEntry(K key,
-        ReferenceEntry<K, V> original, ReferenceEntry<K, V> newNext) {
-      ValueReference<K, V> valueReference = original.getValueReference();
-      if (valueReference == COMPUTING) {
-        ReferenceEntry<K, V> newEntry
-            = newEntry(key, original.getHash(), newNext);
-        newEntry.setValueReference(
-            new FutureValueReference(original, newEntry));
-        return newEntry;
-      } else {
-        ReferenceEntry<K, V> newEntry
-            = newEntry(key, original.getHash(), newNext);
-        newEntry.setValueReference(valueReference.copyFor(newEntry));
-        return newEntry;
-      }
-    }
-
-    /**
-     * Waits for a computation to complete. Returns the result of the
-     * computation or null if none was available.
-     */
-    public V waitForValue(ReferenceEntry<K, V> entry)
-        throws InterruptedException {
-      ValueReference<K, V> valueReference = entry.getValueReference();
-      if (valueReference == COMPUTING) {
-        synchronized (entry) {
-          while ((valueReference = entry.getValueReference())
-              == COMPUTING) {
-            entry.wait();
-          }
-        }
-      }
-      return valueReference.waitForValue();
-    }
-
-    /**
-     * Used by CustomConcurrentHashMap to retrieve values. Returns null
-     * instead of blocking or throwing an exception.
-     */
-    public V getValue(ReferenceEntry<K, V> entry) {
-      ValueReference<K, V> valueReference = entry.getValueReference();
-      return valueReference.get();
-    }
-
-    public V compute(K key, final ReferenceEntry<K, V> entry,
-        Function<? super K, ? extends V> computer) {
-      V value;
-      try {
-        value = computer.apply(key);
-      } catch (Throwable t) {
-        setValueReference(
-          entry, new ComputationExceptionReference<K, V>(t));
-        throw new ComputationException(t);
-      }
-
-      if (value == null) {
-        String message
-            = computer + " returned null for key " + key + ".";
-        setValueReference(
-            entry, new NullOutputExceptionReference<K, V>(message));
-        throw new NullOutputException(message);
-      } else {
-        setValue(entry, value);
-      }
-      return value;
-    }
-
-    /**
-     * Sets the value reference on an entry and notifies waiting
-     * threads.
-     */
-    void setValueReference(ReferenceEntry<K, V> entry,
-        ValueReference<K, V> valueReference) {
-      boolean notifyOthers = (entry.getValueReference() == COMPUTING);
-      entry.setValueReference(valueReference);
-      if (notifyOthers) {
-        synchronized (entry) {
-          entry.notifyAll();
-        }
-      }
-    }
-
-    /**
-     * Points to an old entry where a value is being computed. Used to
-     * support non-blocking copying of entries during table expansion,
-     * removals, etc.
-     */
-    private class FutureValueReference implements ValueReference<K, V> {
-      final ReferenceEntry<K, V> original;
-      final ReferenceEntry<K, V> newEntry;
-
-      FutureValueReference(
-          ReferenceEntry<K, V> original, ReferenceEntry<K, V> newEntry) {
-        this.original = original;
-        this.newEntry = newEntry;
-      }
-
-      public V get() {
-        boolean success = false;
-        try {
-          V value = original.getValueReference().get();
-          success = true;
-          return value;
-        } finally {
-          if (!success) {
-            removeEntry();
-          }
-        }
-      }
-
-      public ValueReference<K, V> copyFor(ReferenceEntry<K, V> entry) {
-        return new FutureValueReference(original, entry);
-      }
-
-      public V waitForValue() throws InterruptedException {
-        boolean success = false;
-        try {
-          // assert that key != null
-          V value = StrategyImpl.this.waitForValue(original);
-          success = true;
-          return value;
-        } finally {
-          if (!success) {
-            removeEntry();
-          }
-        }
-      }
-
-      /**
-       * Removes the entry in the event of an exception. Ideally,
-       * we'd clean up as soon as the computation completes, but we
-       * can't do that without keeping a reference to this entry from
-       * the original.
-       */
-      void removeEntry() {
-        internals.removeEntry(newEntry);
-      }
-    }
-
-    public ReferenceEntry<K, V> getNext(
-        ReferenceEntry<K, V> entry) {
-      return entry.getNext();
-    }
-
-    public void setInternals(
-        Internals<K, V, ReferenceEntry<K, V>> internals) {
-      this.internals = internals;
-    }
-
-    private static final long serialVersionUID = 0;
-
-    private void writeObject(ObjectOutputStream out)
-        throws IOException {
-      // Custom serialization code ensures that the key and value
-      // strengths are written before the map. We'll need them to
-      // deserialize the map entries.
-      out.writeObject(keyStrength);
-      out.writeObject(valueStrength);
-      out.writeLong(expirationNanos);
-
-      // TODO: It is possible for the strategy to try to use the map
-      // or internals during deserialization, for example, if an
-      // entry gets reclaimed. We could detect this case and queue up
-      // removals to be flushed after we deserialize the map.
-      out.writeObject(internals);
-      out.writeObject(map);
-    }
-
-    /**
-     * Fields used during deserialization. We use a nested class so we
-     * don't load them until we need them. We need to use reflection to
-     * set final fields outside of the constructor.
-     */
-    private static class Fields {
-      static final Field keyStrength = findField("keyStrength");
-      static final Field valueStrength = findField("valueStrength");
-      static final Field expirationNanos = findField("expirationNanos");
-      static final Field internals = findField("internals");
-      static final Field map = findField("map");
-
-      static Field findField(String name) {
-        try {
-          Field f = StrategyImpl.class.getDeclaredField(name);
-          f.setAccessible(true);
-          return f;
-        } catch (NoSuchFieldException e) {
-          throw new AssertionError(e);
-        }
-      }
-    }
-
-    private void readObject(ObjectInputStream in)
-        throws IOException, ClassNotFoundException {
-      try {
-        Fields.keyStrength.set(this, in.readObject());
-        Fields.valueStrength.set(this, in.readObject());
-        Fields.expirationNanos.set(this, in.readLong());
-        Fields.internals.set(this, in.readObject());
-        Fields.map.set(this, in.readObject());
-      } catch (IllegalAccessException e) {
-        throw new AssertionError(e);
-      }
-    }
-  }
-
-  /** A reference to a value. */
-  private interface ValueReference<K, V> {
-    /**
-     * Gets the value. Does not block or throw exceptions.
-     */
-    V get();
-
-    /** Creates a copy of this reference for the given entry. */
-    ValueReference<K, V> copyFor(ReferenceEntry<K, V> entry);
-
-    /**
-     * Waits for a value that may still be computing. Unlike get(),
-     * this method can block (in the case of FutureValueReference) or
-     * throw an exception.
-     */
-    V waitForValue() throws InterruptedException;
-  }
-
-  private static final ValueReference<Object, Object> COMPUTING
-      = new ValueReference<Object, Object>() {
-    public Object get() {
-      return null;
-    }
-    public ValueReference<Object, Object> copyFor(
-        ReferenceEntry<Object, Object> entry) {
-      throw new AssertionError();
-    }
-    public Object waitForValue() {
-      throw new AssertionError();
-    }
-  };
-
-  /**
-   * Singleton placeholder that indicates a value is being computed.
-   */
-  @SuppressWarnings("unchecked")
-  // Safe because impl never uses a parameter or returns any non-null value
-  private static <K, V> ValueReference<K, V> computing() {
-    return (ValueReference<K, V>) COMPUTING;
-  }
-
-  /** Used to provide null output exceptions to other threads. */
-  private static class NullOutputExceptionReference<K, V>
-      implements ValueReference<K, V> {
-    final String message;
-    NullOutputExceptionReference(String message) {
-      this.message = message;
-    }
-    public V get() {
-      return null;
-    }
-    public ValueReference<K, V> copyFor(
-        ReferenceEntry<K, V> entry) {
-      return this;
-    }
-    public V waitForValue() {
-      throw new NullOutputException(message);
-    }
-  }
-
-  /** Used to provide computation exceptions to other threads. */
-  private static class ComputationExceptionReference<K, V>
-      implements ValueReference<K, V> {
-    final Throwable t;
-    ComputationExceptionReference(Throwable t) {
-      this.t = t;
-    }
-    public V get() {
-      return null;
-    }
-    public ValueReference<K, V> copyFor(
-        ReferenceEntry<K, V> entry) {
-      return this;
-    }
-    public V waitForValue() {
-      throw new AsynchronousComputationException(t);
-    }
-  }
-
-  /** Wrapper class ensures that queue isn't created until it's used. */
-  private static class QueueHolder {
-    static final FinalizableReferenceQueue queue
-        = new FinalizableReferenceQueue();
-  }
-
-  /**
-   * An entry in a reference map.
-   */
-  private interface ReferenceEntry<K, V> {
-    /**
-     * Gets the value reference from this entry.
-     */
-    ValueReference<K, V> getValueReference();
-
-    /**
-     * Sets the value reference for this entry.
-     *
-     * @param valueReference
-     */
-    void setValueReference(ValueReference<K, V> valueReference);
-
-    /**
-     * Removes this entry from the map if its value reference hasn't
-     * changed.  Used to clean up after values. The value reference can
-     * just call this method on the entry so it doesn't have to keep
-     * its own reference to the map.
-     */
-    void valueReclaimed();
-
-    /** Gets the next entry in the chain. */
-    ReferenceEntry<K, V> getNext();
-
-    /** Gets the entry's hash. */
-    int getHash();
-
-    /** Gets the key for this entry. */
-    public K getKey();
-  }
-
-  /**
-   * Used for strongly-referenced keys.
-   */
-  private static class StrongEntry<K, V> implements ReferenceEntry<K, V> {
-    final K key;
-
-    StrongEntry(Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-        int hash) {
-      this.internals = internals;
-      this.key = key;
-      this.hash = hash;
-    }
-
-    public K getKey() {
-      return this.key;
-    }
-
-    // The code below is exactly the same for each entry type.
-
-    final Internals<K, V, ReferenceEntry<K, V>> internals;
-    final int hash;
-    volatile ValueReference<K, V> valueReference = computing();
-
-    public ValueReference<K, V> getValueReference() {
-      return valueReference;
-    }
-    public void setValueReference(
-        ValueReference<K, V> valueReference) {
-      this.valueReference = valueReference;
-    }
-    public void valueReclaimed() {
-      internals.removeEntry(this, null);
-    }
-    public ReferenceEntry<K, V> getNext() {
-      return null;
-    }
-    public int getHash() {
-      return hash;
-    }
-  }
-
-  private static class LinkedStrongEntry<K, V> extends StrongEntry<K, V> {
-
-    LinkedStrongEntry(Internals<K, V, ReferenceEntry<K, V>> internals,
-        K key, int hash, ReferenceEntry<K, V> next) {
-      super(internals, key, hash);
-      this.next = next;
-    }
-
-    final ReferenceEntry<K, V> next;
-
-    @Override public ReferenceEntry<K, V> getNext() {
-      return next;
-    }
-  }
-
-  /**
-   * Used for softly-referenced keys.
-   */
-  private static class SoftEntry<K, V> extends FinalizableSoftReference<K>
-      implements ReferenceEntry<K, V> {
-    SoftEntry(Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-        int hash) {
-      super(key, QueueHolder.queue);
-      this.internals = internals;
-      this.hash = hash;
-    }
-
-    public K getKey() {
-      return get();
-    }
-
-    public void finalizeReferent() {
-      internals.removeEntry(this);
-    }
-
-    // The code below is exactly the same for each entry type.
-
-    final Internals<K, V, ReferenceEntry<K, V>> internals;
-    final int hash;
-    volatile ValueReference<K, V> valueReference = computing();
-
-    public ValueReference<K, V> getValueReference() {
-      return valueReference;
-    }
-    public void setValueReference(
-        ValueReference<K, V> valueReference) {
-      this.valueReference = valueReference;
-    }
-    public void valueReclaimed() {
-      internals.removeEntry(this, null);
-    }
-    public ReferenceEntry<K, V> getNext() {
-      return null;
-    }
-    public int getHash() {
-      return hash;
-    }
-  }
-
-  private static class LinkedSoftEntry<K, V> extends SoftEntry<K, V> {
-    LinkedSoftEntry(Internals<K, V, ReferenceEntry<K, V>> internals,
-        K key, int hash, ReferenceEntry<K, V> next) {
-      super(internals, key, hash);
-      this.next = next;
-    }
-
-    final ReferenceEntry<K, V> next;
-
-    @Override public ReferenceEntry<K, V> getNext() {
-      return next;
-    }
-  }
-
-  /**
-   * Used for weakly-referenced keys.
-   */
-  private static class WeakEntry<K, V> extends FinalizableWeakReference<K>
-      implements ReferenceEntry<K, V> {
-    WeakEntry(Internals<K, V, ReferenceEntry<K, V>> internals, K key,
-        int hash) {
-      super(key, QueueHolder.queue);
-      this.internals = internals;
-      this.hash = hash;
-    }
-
-    public K getKey() {
-      return get();
-    }
-
-    public void finalizeReferent() {
-      internals.removeEntry(this);
-    }
-
-    // The code below is exactly the same for each entry type.
-
-    final Internals<K, V, ReferenceEntry<K, V>> internals;
-    final int hash;
-    volatile ValueReference<K, V> valueReference = computing();
-
-    public ValueReference<K, V> getValueReference() {
-      return valueReference;
-    }
-    public void setValueReference(
-        ValueReference<K, V> valueReference) {
-      this.valueReference = valueReference;
-    }
-    public void valueReclaimed() {
-      internals.removeEntry(this, null);
-    }
-    public ReferenceEntry<K, V> getNext() {
-      return null;
-    }
-    public int getHash() {
-      return hash;
-    }
-  }
-
-  private static class LinkedWeakEntry<K, V> extends WeakEntry<K, V> {
-    LinkedWeakEntry(Internals<K, V, ReferenceEntry<K, V>> internals,
-        K key, int hash, ReferenceEntry<K, V> next) {
-      super(internals, key, hash);
-      this.next = next;
-    }
-
-    final ReferenceEntry<K, V> next;
-
-    @Override public ReferenceEntry<K, V> getNext() {
-      return next;
-    }
-  }
-
-  /** References a weak value. */
-  private static class WeakValueReference<K, V>
-      extends FinalizableWeakReference<V>
-      implements ValueReference<K, V> {
-    final ReferenceEntry<K, V> entry;
-
-    WeakValueReference(V referent, ReferenceEntry<K, V> entry) {
-      super(referent, QueueHolder.queue);
-      this.entry = entry;
-    }
-
-    public void finalizeReferent() {
-      entry.valueReclaimed();
-    }
-
-    public ValueReference<K, V> copyFor(
-        ReferenceEntry<K, V> entry) {
-      return new WeakValueReference<K, V>(get(), entry);
-    }
-
-    public V waitForValue() throws InterruptedException {
-      return get();
-    }
-  }
-
-  /** References a soft value. */
-  private static class SoftValueReference<K, V>
-      extends FinalizableSoftReference<V>
-      implements ValueReference<K, V> {
-    final ReferenceEntry<K, V> entry;
-
-    SoftValueReference(V referent, ReferenceEntry<K, V> entry) {
-      super(referent, QueueHolder.queue);
-      this.entry = entry;
-    }
-
-    public void finalizeReferent() {
-      entry.valueReclaimed();
-    }
-
-    public ValueReference<K, V> copyFor(
-        ReferenceEntry<K, V> entry) {
-      return new SoftValueReference<K, V>(get(), entry);
-    }
-
-    public V waitForValue() {
-      return get();
-    }
-  }
-
-  /** References a strong value. */
-  private static class StrongValueReference<K, V>
-      implements ValueReference<K, V> {
-    final V referent;
-
-    StrongValueReference(V referent) {
-      this.referent = referent;
-    }
-
-    public V get() {
-      return referent;
-    }
-
-    public ValueReference<K, V> copyFor(
-        ReferenceEntry<K, V> entry) {
-      return this;
-    }
-
-    public V waitForValue() {
-      return get();
-    }
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Maps.java b/core/src/com/google/inject/internal/util/Maps.java
deleted file mode 100644
index 7ecf1be..0000000
--- a/core/src/com/google/inject/internal/util/Maps.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-/**
- * Static utility methods pertaining to {@link Map} instances. Also see this
- * class's counterparts {@link Lists} and {@link Sets}.
- *
- * @author Kevin Bourrillion
- * @author Mike Bostock
- * @author Isaac Shum
- */
-public final class Maps {
-  private Maps() {}
-
-  /**
-   * Creates a {@code HashMap} instance.
-   *
-   * <p><b>Note:</b> if you don't actually need the resulting map to be mutable,
-   * use {@link Collections#emptyMap} instead.
-   *
-   * @return a new, empty {@code HashMap}
-   */
-  public static <K, V> HashMap<K, V> newHashMap() {
-    return new HashMap<K, V>();
-  }
-
-  /**
-   * Creates an insertion-ordered {@code LinkedHashMap} instance.
-   *
-   * @return a new, empty {@code LinkedHashMap}
-   */
-  public static <K, V> LinkedHashMap<K, V> newLinkedHashMap() {
-    return new LinkedHashMap<K, V>();
-  }
-
-  /**
-   * Creates a {@code TreeMap} instance using the natural ordering of its
-   * elements.
-   *
-   * @return a new, empty {@code TreeMap}
-   */
-  @SuppressWarnings("unchecked")  // allow ungenerified Comparable types
-  public static <K extends Comparable, V> TreeMap<K, V> newTreeMap() {
-    return new TreeMap<K, V>();
-  }
-
-  /**
-   * Creates an {@code IdentityHashMap} instance.
-   *
-   * @return a new, empty {@code IdentityHashMap}
-   */
-  public static <K, V> IdentityHashMap<K, V> newIdentityHashMap() {
-    return new IdentityHashMap<K, V>();
-  }
-
-  /**
-   * Returns an immutable map entry with the specified key and value. The {@link
-   * Entry#setValue} operation throws an {@link UnsupportedOperationException}.
-   *
-   * <p>The returned entry is serializable.
-   *
-   * @param key the key to be associated with the returned entry
-   * @param value the value to be associated with the returned entry
-   */
-  public static <K, V> Entry<K, V> immutableEntry(
-      @Nullable final K key, @Nullable final V value) {
-    return new ImmutableEntry<K, V>(key, value);
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Nullable.java b/core/src/com/google/inject/internal/util/Nullable.java
deleted file mode 100644
index 3236c07..0000000
--- a/core/src/com/google/inject/internal/util/Nullable.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * The presence of this annotation on a method parameter indicates that
- * {@code null} is an acceptable value for that parameter.  It should not be
- * used for parameters of primitive types.
- * 
- * <p>This annotation may be used with the Google Web Toolkit (GWT).
- * 
- * @author Kevin Bourrillion
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.PARAMETER, ElementType.FIELD})
-public @interface Nullable { }
diff --git a/core/src/com/google/inject/internal/util/ObjectArrays.java b/core/src/com/google/inject/internal/util/ObjectArrays.java
deleted file mode 100644
index db69b02..0000000
--- a/core/src/com/google/inject/internal/util/ObjectArrays.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.lang.reflect.Array;
-
-/**
- * Static utility methods pertaining to object arrays.
- *
- * @author Kevin Bourrillion
- */
-public final class ObjectArrays {
-  private ObjectArrays() {}
-
-  /**
-   * Returns a new array of the given length with the same type as a reference
-   * array.
-   *
-   * @param reference any array of the desired type
-   * @param length the length of the new array
-   */
-  public static <T> T[] newArray(T[] reference, int length) {
-    Class<?> type = reference.getClass().getComponentType();
-
-    // the cast is safe because result.getClass() == reference.getClass()
-    @SuppressWarnings("unchecked")
-    T[] result = (T[]) Array.newInstance(type, length);
-    return result;
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Objects.java b/core/src/com/google/inject/internal/util/Objects.java
deleted file mode 100644
index 6e684bb..0000000
--- a/core/src/com/google/inject/internal/util/Objects.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Arrays;
-
-/**
- * Helper functions that can operate on any {@code Object}.
- *
- * @author Laurence Gonsalves
- */
-public final class Objects {
-  private Objects() {}
-
-  /**
-   * Determines whether two possibly-null objects are equal. Returns:
-   *
-   * <ul>
-   * <li>{@code true} if {@code a} and {@code b} are both null.
-   * <li>{@code true} if {@code a} and {@code b} are both non-null and they are
-   *     equal according to {@link Object#equals(Object)}.
-   * <li>{@code false} in all other situations.
-   * </ul>
-   *
-   * <p>This assumes that any non-null objects passed to this function conform
-   * to the {@code equals()} contract.
-   */
-  public static boolean equal(@Nullable Object a, @Nullable Object b) {
-    return a == b || (a != null && a.equals(b));
-  }
-
-  /**
-   * Generates a hash code for multiple values. The hash code is generated by
-   * calling {@link Arrays#hashCode(Object[])}.
-   *
-   * <p>This is useful for implementing {@link Object#hashCode()}. For example,
-   * in an object that has three properties, {@code x}, {@code y}, and
-   * {@code z}, one could write:
-   * <pre>
-   * public int hashCode() {
-   *   return Objects.hashCode(getX(), getY(), getZ());
-   * }</pre>
-   *
-   * <b>Warning</b>: When a single object is supplied, the returned hash code
-   * does not equal the hash code of that object.
-   */
-  public static int hashCode(Object... objects) {
-    return Arrays.hashCode(objects);
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Preconditions.java b/core/src/com/google/inject/internal/util/Preconditions.java
deleted file mode 100644
index e72b6a7..0000000
--- a/core/src/com/google/inject/internal/util/Preconditions.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Collection;
-import java.util.NoSuchElementException;
-
-/**
- * Simple static methods to be called at the start of your own methods to verify
- * correct arguments and state. This allows constructs such as
- * <pre>
- *     if (count <= 0) {
- *       throw new IllegalArgumentException("must be positive: " + count);
- *     }</pre>
- *
- * to be replaced with the more compact
- * <pre>
- *     checkArgument(count > 0, "must be positive: %s", count);</pre>
- *
- * Note that the sense of the expression is inverted; with {@code Preconditions}
- * you declare what you expect to be <i>true</i>, just as you do with an
- * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/assert.html">
- * {@code assert}</a> or a JUnit {@code assertTrue()} call.
- *
- * <p>Take care not to confuse precondition checking with other similar types
- * of checks! Precondition exceptions -- including those provided here, but also
- * {@link IndexOutOfBoundsException}, {@link NoSuchElementException}, {@link
- * UnsupportedOperationException} and others -- are used to signal that the
- * <i>calling method</i> has made an error. This tells the caller that it should
- * not have invoked the method when it did, with the arguments it did, or
- * perhaps <i>ever</i>. Postcondition or other invariant failures should not
- * throw these types of exceptions.
- *
- * <p><b>Note:</b> The methods of the {@code Preconditions} class are highly
- * unusual in one way: they are <i>supposed to</i> throw exceptions, and promise
- * in their specifications to do so even when given perfectly valid input. That
- * is, {@code null} is a valid parameter to the method {@link
- * #checkNotNull(Object)} -- and technically this parameter could be even marked
- * as {@link com.google.inject.internal.util.Nullable} -- yet the method will still throw an exception anyway,
- * because that's what its contract says to do.
- * 
- * <p>This class may be used with the Google Web Toolkit (GWT).
- *
- * @author Kevin Bourrillion
- */
-public final class Preconditions {
-  private Preconditions() {}
-
-  /**
-   * Ensures the truth of an expression involving one or more parameters to the
-   * calling method.
-   *
-   * @param expression a boolean expression
-   * @throws IllegalArgumentException if {@code expression} is false
-   */
-  public static void checkArgument(boolean expression) {
-    if (!expression) {
-      throw new IllegalArgumentException();
-    }
-  }
-
-  /**
-   * Ensures the truth of an expression involving one or more parameters to the
-   * calling method.
-   *
-   * @param expression a boolean expression
-   * @param errorMessage the exception message to use if the check fails; will
-   *     be converted to a string using {@link String#valueOf(Object)}
-   * @throws IllegalArgumentException if {@code expression} is false
-   */
-  public static void checkArgument(boolean expression, Object errorMessage) {
-    if (!expression) {
-      throw new IllegalArgumentException(String.valueOf(errorMessage));
-    }
-  }
-
-  /**
-   * Ensures the truth of an expression involving one or more parameters to the
-   * calling method.
-   *
-   * @param expression a boolean expression
-   * @param errorMessageTemplate a template for the exception message should the
-   *     check fail. The message is formed by replacing each {@code %s}
-   *     placeholder in the template with an argument. These are matched by
-   *     position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc.
-   *     Unmatched arguments will be appended to the formatted message in square
-   *     braces. Unmatched placeholders will be left as-is.
-   * @param errorMessageArgs the arguments to be substituted into the message
-   *     template. Arguments are converted to strings using
-   *     {@link String#valueOf(Object)}.
-   * @throws IllegalArgumentException if {@code expression} is false
-   * @throws NullPointerException if the check fails and either {@code
-   *     errorMessageTemplate} or {@code errorMessageArgs} is null (don't let
-   *     this happen)
-   */
-  public static void checkArgument(boolean expression,
-      String errorMessageTemplate, Object... errorMessageArgs) {
-    if (!expression) {
-      throw new IllegalArgumentException(
-          format(errorMessageTemplate, errorMessageArgs));
-    }
-  }
-
-  /**
-   * Ensures the truth of an expression involving the state of the calling
-   * instance, but not involving any parameters to the calling method.
-   *
-   * @param expression a boolean expression
-   * @throws IllegalStateException if {@code expression} is false
-   */
-  public static void checkState(boolean expression) {
-    if (!expression) {
-      throw new IllegalStateException();
-    }
-  }
-
-  /**
-   * Ensures the truth of an expression involving the state of the calling
-   * instance, but not involving any parameters to the calling method.
-   *
-   * @param expression a boolean expression
-   * @param errorMessage the exception message to use if the check fails; will
-   *     be converted to a string using {@link String#valueOf(Object)}
-   * @throws IllegalStateException if {@code expression} is false
-   */
-  public static void checkState(boolean expression, Object errorMessage) {
-    if (!expression) {
-      throw new IllegalStateException(String.valueOf(errorMessage));
-    }
-  }
-
-  /**
-   * Ensures the truth of an expression involving the state of the calling
-   * instance, but not involving any parameters to the calling method.
-   *
-   * @param expression a boolean expression
-   * @param errorMessageTemplate a template for the exception message should the
-   *     check fail. The message is formed by replacing each {@code %s}
-   *     placeholder in the template with an argument. These are matched by
-   *     position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc.
-   *     Unmatched arguments will be appended to the formatted message in square
-   *     braces. Unmatched placeholders will be left as-is.
-   * @param errorMessageArgs the arguments to be substituted into the message
-   *     template. Arguments are converted to strings using
-   *     {@link String#valueOf(Object)}.
-   * @throws IllegalStateException if {@code expression} is false
-   * @throws NullPointerException if the check fails and either {@code
-   *     errorMessageTemplate} or {@code errorMessageArgs} is null (don't let
-   *     this happen)
-   */
-  public static void checkState(boolean expression,
-      String errorMessageTemplate, Object... errorMessageArgs) {
-    if (!expression) {
-      throw new IllegalStateException(
-          format(errorMessageTemplate, errorMessageArgs));
-    }
-  }
-
-  /**
-   * Ensures that an object reference passed as a parameter to the calling
-   * method is not null.
-   *
-   * @param reference an object reference
-   * @return the non-null reference that was validated
-   * @throws NullPointerException if {@code reference} is null
-   */
-  public static <T> T checkNotNull(T reference) {
-    if (reference == null) {
-      throw new NullPointerException();
-    }
-    return reference;
-  }
-
-  /**
-   * Ensures that an object reference passed as a parameter to the calling
-   * method is not null.
-   *
-   * @param reference an object reference
-   * @param errorMessage the exception message to use if the check fails; will
-   *     be converted to a string using {@link String#valueOf(Object)}
-   * @return the non-null reference that was validated
-   * @throws NullPointerException if {@code reference} is null
-   */
-  public static <T> T checkNotNull(T reference, Object errorMessage) {
-    if (reference == null) {
-      throw new NullPointerException(String.valueOf(errorMessage));
-    }
-    return reference;
-  }
-
-  /**
-   * Ensures that an object reference passed as a parameter to the calling
-   * method is not null.
-   *
-   * @param reference an object reference
-   * @param errorMessageTemplate a template for the exception message should the
-   *     check fail. The message is formed by replacing each {@code %s}
-   *     placeholder in the template with an argument. These are matched by
-   *     position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc.
-   *     Unmatched arguments will be appended to the formatted message in square
-   *     braces. Unmatched placeholders will be left as-is.
-   * @param errorMessageArgs the arguments to be substituted into the message
-   *     template. Arguments are converted to strings using
-   *     {@link String#valueOf(Object)}.
-   * @return the non-null reference that was validated
-   * @throws NullPointerException if {@code reference} is null
-   */
-  public static <T> T checkNotNull(T reference, String errorMessageTemplate,
-      Object... errorMessageArgs) {
-    if (reference == null) {
-      // If either of these parameters is null, the right thing happens anyway
-      throw new NullPointerException(
-          format(errorMessageTemplate, errorMessageArgs));
-    }
-    return reference;
-  }
-
-  /**
-   * Ensures that an {@code Iterable} object passed as a parameter to the
-   * calling method is not null and contains no null elements.
-   *
-   * @param iterable the iterable to check the contents of
-   * @return the non-null {@code iterable} reference just validated
-   * @throws NullPointerException if {@code iterable} is null or contains at
-   *     least one null element
-   */
-  public static <T extends Iterable<?>> T checkContentsNotNull(T iterable) {
-    if (containsOrIsNull(iterable)) {
-      throw new NullPointerException();
-    }
-    return iterable;
-  }
-
-  /**
-   * Ensures that an {@code Iterable} object passed as a parameter to the
-   * calling method is not null and contains no null elements.
-   *
-   * @param iterable the iterable to check the contents of
-   * @param errorMessage the exception message to use if the check fails; will
-   *     be converted to a string using {@link String#valueOf(Object)}
-   * @return the non-null {@code iterable} reference just validated
-   * @throws NullPointerException if {@code iterable} is null or contains at
-   *     least one null element
-   */
-  public static <T extends Iterable<?>> T checkContentsNotNull(
-      T iterable, Object errorMessage) {
-    if (containsOrIsNull(iterable)) {
-      throw new NullPointerException(String.valueOf(errorMessage));
-    }
-    return iterable;
-  }
-
-  /**
-   * Ensures that an {@code Iterable} object passed as a parameter to the
-   * calling method is not null and contains no null elements.
-   *
-   * @param iterable the iterable to check the contents of
-   * @param errorMessageTemplate a template for the exception message should the
-   *     check fail. The message is formed by replacing each {@code %s}
-   *     placeholder in the template with an argument. These are matched by
-   *     position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc.
-   *     Unmatched arguments will be appended to the formatted message in square
-   *     braces. Unmatched placeholders will be left as-is.
-   * @param errorMessageArgs the arguments to be substituted into the message
-   *     template. Arguments are converted to strings using
-   *     {@link String#valueOf(Object)}.
-   * @return the non-null {@code iterable} reference just validated
-   * @throws NullPointerException if {@code iterable} is null or contains at
-   *     least one null element
-   */
-  public static <T extends Iterable<?>> T checkContentsNotNull(T iterable,
-      String errorMessageTemplate, Object... errorMessageArgs) {
-    if (containsOrIsNull(iterable)) {
-      throw new NullPointerException(
-          format(errorMessageTemplate, errorMessageArgs));
-    }
-    return iterable;
-  }
-  
-  private static boolean containsOrIsNull(Iterable<?> iterable) {
-    if (iterable == null) {
-      return true;
-    }
-    
-    if (iterable instanceof Collection) {
-      Collection<?> collection = (Collection<?>) iterable;
-      try {
-        return collection.contains(null);
-      } catch (NullPointerException e) {
-        // A NPE implies that the collection doesn't contain null.
-        return false;
-      }
-    } else {
-      for (Object element : iterable) {
-        if (element == null) {
-          return true;
-        }
-      }
-      return false;
-    }
-  }
-
-  /**
-   * Ensures that {@code index} specifies a valid <i>element</i> in an array,
-   * list or string of size {@code size}. An element index may range from zero,
-   * inclusive, to {@code size}, exclusive.
-   *
-   * @param index a user-supplied index identifying an element of an array, list
-   *     or string
-   * @param size the size of that array, list or string
-   * @throws IndexOutOfBoundsException if {@code index} is negative or is not
-   *     less than {@code size}
-   * @throws IllegalArgumentException if {@code size} is negative
-   */
-  public static void checkElementIndex(int index, int size) {
-    checkElementIndex(index, size, "index");
-  }
-
-  /**
-   * Ensures that {@code index} specifies a valid <i>element</i> in an array,
-   * list or string of size {@code size}. An element index may range from zero,
-   * inclusive, to {@code size}, exclusive.
-   *
-   * @param index a user-supplied index identifying an element of an array, list
-   *     or string
-   * @param size the size of that array, list or string
-   * @param desc the text to use to describe this index in an error message
-   * @throws IndexOutOfBoundsException if {@code index} is negative or is not
-   *     less than {@code size}
-   * @throws IllegalArgumentException if {@code size} is negative
-   */
-  public static void checkElementIndex(int index, int size, String desc) {
-    checkArgument(size >= 0, "negative size: %s", size);
-    if (index < 0) {
-      throw new IndexOutOfBoundsException(
-          format("%s (%s) must not be negative", desc, index));
-    }
-    if (index >= size) {
-      throw new IndexOutOfBoundsException(
-          format("%s (%s) must be less than size (%s)", desc, index, size));
-    }
-  }
-
-  /**
-   * Ensures that {@code index} specifies a valid <i>position</i> in an array,
-   * list or string of size {@code size}. A position index may range from zero
-   * to {@code size}, inclusive.
-   *
-   * @param index a user-supplied index identifying a position in an array, list
-   *     or string
-   * @param size the size of that array, list or string
-   * @throws IndexOutOfBoundsException if {@code index} is negative or is
-   *     greater than {@code size}
-   * @throws IllegalArgumentException if {@code size} is negative
-   */
-  public static void checkPositionIndex(int index, int size) {
-    checkPositionIndex(index, size, "index");
-  }
-
-  /**
-   * Ensures that {@code index} specifies a valid <i>position</i> in an array,
-   * list or string of size {@code size}. A position index may range from zero
-   * to {@code size}, inclusive.
-   *
-   * @param index a user-supplied index identifying a position in an array, list
-   *     or string
-   * @param size the size of that array, list or string
-   * @param desc the text to use to describe this index in an error message
-   * @throws IndexOutOfBoundsException if {@code index} is negative or is
-   *     greater than {@code size}
-   * @throws IllegalArgumentException if {@code size} is negative
-   */
-  public static void checkPositionIndex(int index, int size, String desc) {
-    checkArgument(size >= 0, "negative size: %s", size);
-    if (index < 0) {
-      throw new IndexOutOfBoundsException(format(
-          "%s (%s) must not be negative", desc, index));
-    }
-    if (index > size) {
-      throw new IndexOutOfBoundsException(format(
-          "%s (%s) must not be greater than size (%s)", desc, index, size));
-    }
-  }
-
-  /**
-   * Ensures that {@code start} and {@code end} specify a valid <i>positions</i>
-   * in an array, list or string of size {@code size}, and are in order. A
-   * position index may range from zero to {@code size}, inclusive.
-   *
-   * @param start a user-supplied index identifying a starting position in an
-   *     array, list or string
-   * @param end a user-supplied index identifying a ending position in an array,
-   *     list or string
-   * @param size the size of that array, list or string
-   * @throws IndexOutOfBoundsException if either index is negative or is
-   *     greater than {@code size}, or if {@code end} is less than {@code start}
-   * @throws IllegalArgumentException if {@code size} is negative
-   */
-  public static void checkPositionIndexes(int start, int end, int size) {
-    checkPositionIndex(start, size, "start index");
-    checkPositionIndex(end, size, "end index");
-    if (end < start) {
-      throw new IndexOutOfBoundsException(format(
-          "end index (%s) must not be less than start index (%s)", end, start));
-    }
-  }
-
-  /**
-   * Substitutes each {@code %s} in {@code template} with an argument. These
-   * are matched by position - the first {@code %s} gets {@code args[0]}, etc.
-   * If there are more arguments than placeholders, the unmatched arguments will
-   * be appended to the end of the formatted message in square braces.
-   *
-   * @param template a non-null string containing 0 or more {@code %s}
-   *     placeholders.
-   * @param args the arguments to be substituted into the message
-   *     template. Arguments are converted to strings using
-   *     {@link String#valueOf(Object)}. Arguments can be null.
-   */
-  // VisibleForTesting
-  static String format(String template, Object... args) {
-    // start substituting the arguments into the '%s' placeholders
-    StringBuilder builder = new StringBuilder(
-        template.length() + 16 * args.length);
-    int templateStart = 0;
-    int i = 0;
-    while (i < args.length) {
-      int placeholderStart = template.indexOf("%s", templateStart);
-      if (placeholderStart == -1) {
-        break;
-      }
-      builder.append(template.substring(templateStart, placeholderStart));
-      builder.append(args[i++]);
-      templateStart = placeholderStart + 2;
-    }
-    builder.append(template.substring(templateStart));
-
-    // if we run out of placeholders, append the extra args in square braces
-    if (i < args.length) {
-      builder.append(" [");
-      builder.append(args[i++]);
-      while (i < args.length) {
-        builder.append(", ");
-        builder.append(args[i++]);
-      }
-      builder.append("]");
-    }
-
-    return builder.toString();
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/Sets.java b/core/src/com/google/inject/internal/util/Sets.java
deleted file mode 100644
index 7edea44..0000000
--- a/core/src/com/google/inject/internal/util/Sets.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.util.AbstractSet;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-/**
- * Static utility methods pertaining to {@link Set} instances. Also see this
- * class's counterparts {@link Lists} and {@link Maps}.
- *
- * @author Kevin Bourrillion
- * @author Jared Levy
- */
-public final class Sets {
-  private Sets() {}
-
-  // HashSet
-
-  /**
-   * Creates an empty {@code HashSet} instance.
-   *
-   * <p><b>Note:</b> if {@code E} is an {@link Enum} type, use {@link
-   * EnumSet#noneOf} instead.
-   *
-   * <p><b>Note:</b> if you need an <i>immutable</i> empty Set, use {@link
-   * Collections#emptySet} instead.
-   *
-   * @return a newly created, empty {@code HashSet}
-   */
-  public static <E> HashSet<E> newHashSet() {
-    return new HashSet<E>();
-  }
-
-  // TODO: Modify the sets returned by newConcurrentHashSet so calling
-  // remove(null) on them doesn't throw an NPE.
-
-  // LinkedHashSet
-
-  /**
-   * Creates an empty {@code LinkedHashSet} instance.
-   *
-   * @return a newly created, empty {@code LinkedHashSet}
-   */
-  public static <E> LinkedHashSet<E> newLinkedHashSet() {
-    return new LinkedHashSet<E>();
-  }
-
-  /*
-   * Regarding newSetForMap() and SetFromMap:
-   *
-   * Written by Doug Lea with assistance from members of JCP JSR-166
-   * Expert Group and released to the public domain, as explained at
-   * http://creativecommons.org/licenses/publicdomain
-   */
-
-  /**
-   * Returns a set backed by the specified map. The resulting set displays
-   * the same ordering, concurrency, and performance characteristics as the
-   * backing map. In essence, this factory method provides a {@link Set}
-   * implementation corresponding to any {@link Map} implementation. There is no
-   * need to use this method on a {@link Map} implementation that already has a
-   * corresponding {@link Set} implementation (such as {@link HashMap} or
-   * {@link TreeMap}).
-   *
-   * <p>Each method invocation on the set returned by this method results in
-   * exactly one method invocation on the backing map or its <tt>keySet</tt>
-   * view, with one exception. The <tt>addAll</tt> method is implemented as a
-   * sequence of <tt>put</tt> invocations on the backing map.
-   *
-   * <p>The specified map must be empty at the time this method is invoked,
-   * and should not be accessed directly after this method returns. These
-   * conditions are ensured if the map is created empty, passed directly
-   * to this method, and no reference to the map is retained, as illustrated
-   * in the following code fragment:
-   * <pre>
-   *    Set&lt;Object&gt; identityHashSet = Sets.newSetFromMap(
-   *        new IdentityHashMap&lt;Object, Boolean&gt;()); </pre>
-   *
-   * This method has the same behavior as the JDK 6 method
-   * {@code Collections.newSetFromMap()}. The returned set is serializable if
-   * the backing map is.
-   *
-   * @param map the backing map
-   * @return the set backed by the map
-   * @throws IllegalArgumentException if <tt>map</tt> is not empty
-   */
-  public static <E> Set<E> newSetFromMap(Map<E, Boolean> map) {
-    return new SetFromMap<E>(map);
-  }
-
-  private static class SetFromMap<E> extends AbstractSet<E>
-      implements Set<E>, Serializable {
-    private final Map<E, Boolean> m; // The backing map
-    private transient Set<E> s; // Its keySet
-
-    SetFromMap(Map<E, Boolean> map) {
-      Preconditions.checkArgument(map.isEmpty(), "Map is non-empty");
-      m = map;
-      s = map.keySet();
-    }
-
-    @Override public void clear() {
-      m.clear();
-    }
-    @Override public int size() {
-      return m.size();
-    }
-    @Override public boolean isEmpty() {
-      return m.isEmpty();
-    }
-    @Override public boolean contains(Object o) {
-      return m.containsKey(o);
-    }
-    @Override public boolean remove(Object o) {
-      return m.remove(o) != null;
-    }
-    @Override public boolean add(E e) {
-      return m.put(e, Boolean.TRUE) == null;
-    }
-    @Override public Iterator<E> iterator() {
-      return s.iterator();
-    }
-    @Override public Object[] toArray() {
-      return s.toArray();
-    }
-    @Override public <T> T[] toArray(T[] a) {
-      return s.toArray(a);
-    }
-    @Override public String toString() {
-      return s.toString();
-    }
-    @Override public int hashCode() {
-      return s.hashCode();
-    }
-    @Override public boolean equals(@Nullable Object object) {
-      return this == object || this.s.equals(object);
-    }
-    @Override public boolean containsAll(Collection<?> c) {
-      return s.containsAll(c);
-    }
-    @Override public boolean removeAll(Collection<?> c) {
-      return s.removeAll(c);
-    }
-    @Override public boolean retainAll(Collection<?> c) {
-      return s.retainAll(c);
-    }
-
-    // addAll is the only inherited implementation
-
-    static final long serialVersionUID = 0;
-
-    private void readObject(ObjectInputStream stream)
-        throws IOException, ClassNotFoundException {
-      stream.defaultReadObject();
-      s = m.keySet();
-    }
-  }
-
-  /**
-   * Calculates and returns the hash code of {@code s}.
-   */
-  static int hashCodeImpl(Set<?> s) {
-    int hashCode = 0;
-    for (Object o : s) {
-      hashCode += o != null ? o.hashCode() : 0;
-    }
-    return hashCode;
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/SourceProvider.java b/core/src/com/google/inject/internal/util/SourceProvider.java
index 17deeda..18c6689 100644
--- a/core/src/com/google/inject/internal/util/SourceProvider.java
+++ b/core/src/com/google/inject/internal/util/SourceProvider.java
@@ -16,9 +16,12 @@
 
 package com.google.inject.internal.util;
 
-import static com.google.inject.internal.util.Iterables.concat;
+import static com.google.common.collect.Iterables.concat;
 import java.util.List;
 
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+
 /**
  * Provides access to the calling line of code.
  * 
diff --git a/core/src/com/google/inject/internal/util/StackTraceElements.java b/core/src/com/google/inject/internal/util/StackTraceElements.java
index 0af1c26..3c86ebc 100644
--- a/core/src/com/google/inject/internal/util/StackTraceElements.java
+++ b/core/src/com/google/inject/internal/util/StackTraceElements.java
@@ -21,6 +21,9 @@
 import java.lang.reflect.Member;
 import java.util.Map;
 
+import com.google.common.base.Function;
+import com.google.common.collect.MapMaker;
+
 /**
  * Creates stack trace elements for members.
  *
diff --git a/core/src/com/google/inject/internal/util/Strings.java b/core/src/com/google/inject/internal/util/Strings.java
deleted file mode 100644
index 3021f7a..0000000
--- a/core/src/com/google/inject/internal/util/Strings.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright (C) 2006 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * String utilities.
- * 
- * @author crazybob@google.com (Bob Lee)
- */
-public class Strings {
-  private Strings() {}
-
-  /**
-   * Returns a string that is equivalent to the specified string with its
-   * first character converted to uppercase as by {@link String#toUpperCase}.
-   * The returned string will have the same value as the specified string if
-   * its first character is non-alphabetic, if its first character is already
-   * uppercase, or if the specified string is of length 0.
-   *
-   * <p>For example:
-   * <pre>
-   *    capitalize("foo bar").equals("Foo bar");
-   *    capitalize("2b or not 2b").equals("2b or not 2b")
-   *    capitalize("Foo bar").equals("Foo bar");
-   *    capitalize("").equals("");
-   * </pre>
-   *
-   * @param s the string whose first character is to be uppercased
-   * @return a string equivalent to <tt>s</tt> with its first character
-   *     converted to uppercase
-   * @throws NullPointerException if <tt>s</tt> is null
-   */
-  public static String capitalize(String s) {
-    if (s.length() == 0) {
-      return s;
-    }
-    char first = s.charAt(0);
-    char capitalized = Character.toUpperCase(first);
-    return (first == capitalized)
-        ? s
-        : capitalized + s.substring(1);
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/ToStringBuilder.java b/core/src/com/google/inject/internal/util/ToStringBuilder.java
deleted file mode 100644
index 9e75fa8..0000000
--- a/core/src/com/google/inject/internal/util/ToStringBuilder.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright (C) 2006 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Helps with {@code toString()} methods.
- *
- * @author crazybob@google.com (Bob Lee)
- */
-public class ToStringBuilder {
-
-  // Linked hash map ensures ordering.
-  final Map<String, Object> map = new LinkedHashMap<String, Object>();
-
-  final String name;
-
-  public ToStringBuilder(Class type) {
-    this.name = type.getSimpleName();
-  }
-
-  public ToStringBuilder add(String name, Object value) {
-    if (map.put(name, value) != null) {
-      throw new RuntimeException("Duplicate names: " + name);
-    }
-    return this;
-  }
-
-  @Override public String toString() {
-    return name + map.toString().replace('{', '[').replace('}', ']');
-  }
-}
diff --git a/core/src/com/google/inject/internal/util/UnmodifiableIterator.java b/core/src/com/google/inject/internal/util/UnmodifiableIterator.java
deleted file mode 100644
index d19a49b..0000000
--- a/core/src/com/google/inject/internal/util/UnmodifiableIterator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Iterator;
-
-/**
- * An iterator that does not support {@link #remove}.
- *
- * @author Jared Levy
- */
-public abstract class UnmodifiableIterator<E> implements Iterator<E> {
-
-  /**
-   * Guaranteed to throw an exception and leave the underlying data unmodified.
-   *
-   * @throws UnsupportedOperationException always
-   */
-  public final void remove() {
-    throw new UnsupportedOperationException();
-  }
-}
diff --git a/core/src/com/google/inject/matcher/Matchers.java b/core/src/com/google/inject/matcher/Matchers.java
index e6a0bf5..cbfa715 100644
--- a/core/src/com/google/inject/matcher/Matchers.java
+++ b/core/src/com/google/inject/matcher/Matchers.java
@@ -16,8 +16,8 @@
 
 package com.google.inject.matcher;
 
-import static com.google.inject.internal.util.Preconditions.checkArgument;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.annotation.Retention;
diff --git a/core/src/com/google/inject/name/NamedImpl.java b/core/src/com/google/inject/name/NamedImpl.java
index 8690c51..fba2a8f 100644
--- a/core/src/com/google/inject/name/NamedImpl.java
+++ b/core/src/com/google/inject/name/NamedImpl.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.name;
 
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 
diff --git a/core/src/com/google/inject/spi/Dependency.java b/core/src/com/google/inject/spi/Dependency.java
index 913f203..77fbb30 100644
--- a/core/src/com/google/inject/spi/Dependency.java
+++ b/core/src/com/google/inject/spi/Dependency.java
@@ -17,10 +17,10 @@
 package com.google.inject.spi;
 
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Objects;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.base.Objects;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.util.List;
 import java.util.Set;
 
diff --git a/core/src/com/google/inject/spi/DisableCircularProxiesOption.java b/core/src/com/google/inject/spi/DisableCircularProxiesOption.java
index 67c4bf2..e45c7c0 100644
--- a/core/src/com/google/inject/spi/DisableCircularProxiesOption.java
+++ b/core/src/com/google/inject/spi/DisableCircularProxiesOption.java
@@ -17,7 +17,7 @@
 package com.google.inject.spi;

 

 import com.google.inject.Binder;

-import static com.google.inject.internal.util.Preconditions.checkNotNull;

+import static com.google.common.base.Preconditions.checkNotNull;

 

 /**

  * A request to disable circular proxies.

diff --git a/core/src/com/google/inject/spi/Elements.java b/core/src/com/google/inject/spi/Elements.java
index dc222bc..aa33be9 100644
--- a/core/src/com/google/inject/spi/Elements.java
+++ b/core/src/com/google/inject/spi/Elements.java
@@ -38,10 +38,10 @@
 import com.google.inject.internal.ExposureBuilder;
 import com.google.inject.internal.PrivateElementsImpl;
 import com.google.inject.internal.ProviderMethodsModule;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkArgument;
+import com.google.common.collect.Sets;
 import com.google.inject.internal.util.SourceProvider;
 import com.google.inject.matcher.Matcher;
 import java.lang.annotation.Annotation;
diff --git a/core/src/com/google/inject/spi/InjectionPoint.java b/core/src/com/google/inject/spi/InjectionPoint.java
index 81e2132..c908314 100644
--- a/core/src/com/google/inject/spi/InjectionPoint.java
+++ b/core/src/com/google/inject/spi/InjectionPoint.java
@@ -26,9 +26,9 @@
 import static com.google.inject.internal.MoreTypes.getRawType;
 import com.google.inject.internal.Nullability;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Constructor;
diff --git a/core/src/com/google/inject/spi/InjectionRequest.java b/core/src/com/google/inject/spi/InjectionRequest.java
index f3807bd..da1a305 100644
--- a/core/src/com/google/inject/spi/InjectionRequest.java
+++ b/core/src/com/google/inject/spi/InjectionRequest.java
@@ -19,7 +19,7 @@
 import com.google.inject.Binder;
 import com.google.inject.ConfigurationException;
 import com.google.inject.TypeLiteral;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.util.Set;
 
 /**
diff --git a/core/src/com/google/inject/spi/InterceptorBinding.java b/core/src/com/google/inject/spi/InterceptorBinding.java
index 03c3903..163869e 100644
--- a/core/src/com/google/inject/spi/InterceptorBinding.java
+++ b/core/src/com/google/inject/spi/InterceptorBinding.java
@@ -17,8 +17,8 @@
 package com.google.inject.spi;
 
 import com.google.inject.Binder;
-import com.google.inject.internal.util.ImmutableList;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableList;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.matcher.Matcher;
 import java.lang.reflect.Method;
 import java.util.List;
diff --git a/core/src/com/google/inject/spi/MembersInjectorLookup.java b/core/src/com/google/inject/spi/MembersInjectorLookup.java
index f4bb165..04fa64c 100644
--- a/core/src/com/google/inject/spi/MembersInjectorLookup.java
+++ b/core/src/com/google/inject/spi/MembersInjectorLookup.java
@@ -19,8 +19,8 @@
 import com.google.inject.Binder;
 import com.google.inject.MembersInjector;
 import com.google.inject.TypeLiteral;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 
 /**
  * A lookup of the members injector for a type. Lookups are created explicitly in a module using
diff --git a/core/src/com/google/inject/spi/Message.java b/core/src/com/google/inject/spi/Message.java
index 7b864b5..76a984b 100644
--- a/core/src/com/google/inject/spi/Message.java
+++ b/core/src/com/google/inject/spi/Message.java
@@ -18,9 +18,9 @@
 
 import com.google.inject.Binder;
 import com.google.inject.internal.Errors;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Objects;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableList;
+import com.google.common.base.Objects;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.internal.util.SourceProvider;
 import java.io.ObjectStreamException;
 import java.io.Serializable;
diff --git a/core/src/com/google/inject/spi/ProviderLookup.java b/core/src/com/google/inject/spi/ProviderLookup.java
index 74bc5f0..50e1fb0 100644
--- a/core/src/com/google/inject/spi/ProviderLookup.java
+++ b/core/src/com/google/inject/spi/ProviderLookup.java
@@ -19,8 +19,8 @@
 import com.google.inject.Binder;
 import com.google.inject.Key;
 import com.google.inject.Provider;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 
 /**
  * A lookup of the provider for a type. Lookups are created explicitly in a module using
diff --git a/core/src/com/google/inject/spi/ProvisionListenerBinding.java b/core/src/com/google/inject/spi/ProvisionListenerBinding.java
index 86219bb..b75ac15 100644
--- a/core/src/com/google/inject/spi/ProvisionListenerBinding.java
+++ b/core/src/com/google/inject/spi/ProvisionListenerBinding.java
@@ -20,7 +20,7 @@
 

 import com.google.inject.Binder;

 import com.google.inject.Key;

-import com.google.inject.internal.util.ImmutableList;

+import com.google.common.collect.ImmutableList;

 import com.google.inject.matcher.Matcher;

 

 /**

diff --git a/core/src/com/google/inject/spi/RequireExplicitBindingsOption.java b/core/src/com/google/inject/spi/RequireExplicitBindingsOption.java
index 4515bd4..b2a259d 100644
--- a/core/src/com/google/inject/spi/RequireExplicitBindingsOption.java
+++ b/core/src/com/google/inject/spi/RequireExplicitBindingsOption.java
@@ -17,7 +17,7 @@
 package com.google.inject.spi;

 

 import com.google.inject.Binder;

-import static com.google.inject.internal.util.Preconditions.checkNotNull;

+import static com.google.common.base.Preconditions.checkNotNull;

 

 /**

  * A request to require explicit bindings.

diff --git a/core/src/com/google/inject/spi/ScopeBinding.java b/core/src/com/google/inject/spi/ScopeBinding.java
index f4e6271..b316fce 100644
--- a/core/src/com/google/inject/spi/ScopeBinding.java
+++ b/core/src/com/google/inject/spi/ScopeBinding.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.Binder;
 import com.google.inject.Scope;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.lang.annotation.Annotation;
 
 /**
diff --git a/core/src/com/google/inject/spi/StaticInjectionRequest.java b/core/src/com/google/inject/spi/StaticInjectionRequest.java
index 56b5823..1f6e0be 100644
--- a/core/src/com/google/inject/spi/StaticInjectionRequest.java
+++ b/core/src/com/google/inject/spi/StaticInjectionRequest.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.Binder;
 import com.google.inject.ConfigurationException;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import java.util.Set;
 
 /**
diff --git a/core/src/com/google/inject/spi/TypeConverterBinding.java b/core/src/com/google/inject/spi/TypeConverterBinding.java
index 56c3d46..e6641ad 100644
--- a/core/src/com/google/inject/spi/TypeConverterBinding.java
+++ b/core/src/com/google/inject/spi/TypeConverterBinding.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.Binder;
 import com.google.inject.TypeLiteral;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.matcher.Matcher;
 
 /**
diff --git a/core/src/com/google/inject/util/Modules.java b/core/src/com/google/inject/util/Modules.java
index b6e52cb..91a9c51 100644
--- a/core/src/com/google/inject/util/Modules.java
+++ b/core/src/com/google/inject/util/Modules.java
@@ -24,11 +24,11 @@
 import com.google.inject.PrivateBinder;
 import com.google.inject.PrivateModule;
 import com.google.inject.Scope;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Iterables;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.DefaultBindingScopingVisitor;
 import com.google.inject.spi.DefaultElementVisitor;
 import com.google.inject.spi.Element;
diff --git a/core/src/com/google/inject/util/Node.java b/core/src/com/google/inject/util/Node.java
index 938c5d4..e49c22a 100644
--- a/core/src/com/google/inject/util/Node.java
+++ b/core/src/com/google/inject/util/Node.java
@@ -18,8 +18,8 @@
 
 import com.google.inject.Key;
 import com.google.inject.internal.Errors;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 import java.lang.annotation.Annotation;
 import java.util.Set;
 
diff --git a/core/src/com/google/inject/util/Providers.java b/core/src/com/google/inject/util/Providers.java
index 84e0842..a9cd686 100644
--- a/core/src/com/google/inject/util/Providers.java
+++ b/core/src/com/google/inject/util/Providers.java
@@ -16,15 +16,15 @@
 
 package com.google.inject.util;
 
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.util.Set;
 
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.InjectionPoint;
 import com.google.inject.spi.ProviderWithDependencies;
diff --git a/core/test/com/google/inject/AllTests.java b/core/test/com/google/inject/AllTests.java
index ba7a072..20820d5 100644
--- a/core/test/com/google/inject/AllTests.java
+++ b/core/test/com/google/inject/AllTests.java
@@ -16,11 +16,8 @@
 
 package com.google.inject;
 
-import com.google.inject.internal.util.FinalizableReferenceQueueTest;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Jsr166HashMapTest;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.internal.util.LineNumbersTest;
-import com.google.inject.internal.util.MapMakerTestSuite;
 import com.google.inject.internal.MoreTypesTest;
 import com.google.inject.internal.UniqueAnnotationsTest;
 import com.google.inject.matcher.MatcherTest;
@@ -102,10 +99,7 @@
     suite.addTestSuite(TypeLiteralTypeResolutionTest.class);
 
     // internal
-    suite.addTestSuite(FinalizableReferenceQueueTest.class);
-    suite.addTestSuite(Jsr166HashMapTest.class);
     suite.addTestSuite(LineNumbersTest.class);
-    suite.addTest(MapMakerTestSuite.suite());
     suite.addTestSuite(MoreTypesTest.class);
     suite.addTestSuite(UniqueAnnotationsTest.class);
 
@@ -144,7 +138,6 @@
     /*end[AOP]*/
 
     // googlecode.guice
-    suite.addTest(com.googlecode.guice.StrictContainerTestSuite.suite());
     suite.addTestSuite(com.googlecode.guice.OSGiContainerTest.class);
     suite.addTestSuite(Jsr330Test.class);
 
diff --git a/core/test/com/google/inject/BinderTest.java b/core/test/com/google/inject/BinderTest.java
index 435ab1b..b2d8c3e 100644
--- a/core/test/com/google/inject/BinderTest.java
+++ b/core/test/com/google/inject/BinderTest.java
@@ -18,9 +18,9 @@
 
 import static com.google.inject.Asserts.assertContains;
 import static com.google.inject.Asserts.assertNotSerializable;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Iterables;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import com.google.inject.spi.Message;
diff --git a/core/test/com/google/inject/BinderTestSuite.java b/core/test/com/google/inject/BinderTestSuite.java
index 9e00d5b..6faf821 100644
--- a/core/test/com/google/inject/BinderTestSuite.java
+++ b/core/test/com/google/inject/BinderTestSuite.java
@@ -19,8 +19,8 @@
 import static com.google.inject.Asserts.assertContains;
 import com.google.inject.binder.AnnotatedBindingBuilder;
 import com.google.inject.binder.ScopedBindingBuilder;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import com.google.inject.name.Named;
 import static com.google.inject.name.Names.named;
 import com.google.inject.util.Providers;
diff --git a/core/test/com/google/inject/BindingTest.java b/core/test/com/google/inject/BindingTest.java
index cb51a83..3b519f9 100644
--- a/core/test/com/google/inject/BindingTest.java
+++ b/core/test/com/google/inject/BindingTest.java
@@ -17,8 +17,8 @@
 package com.google.inject;
 
 import static com.google.inject.Asserts.assertContains;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 import com.google.inject.matcher.Matchers;
 import static com.google.inject.name.Names.named;
 
diff --git a/core/test/com/google/inject/DuplicateBindingsTest.java b/core/test/com/google/inject/DuplicateBindingsTest.java
index 6bba731..feb6295 100644
--- a/core/test/com/google/inject/DuplicateBindingsTest.java
+++ b/core/test/com/google/inject/DuplicateBindingsTest.java
@@ -19,8 +19,8 @@
 import static com.google.inject.Asserts.assertContains;

 import static com.google.inject.name.Names.named;

 

-import com.google.inject.internal.util.Lists;

-import com.google.inject.internal.util.Objects;

+import com.google.common.collect.Lists;

+import com.google.common.base.Objects;

 import com.google.inject.name.Named;

 

 import java.lang.annotation.Annotation;

diff --git a/core/test/com/google/inject/GenericInjectionTest.java b/core/test/com/google/inject/GenericInjectionTest.java
index 211a8dd..6cf583f 100644
--- a/core/test/com/google/inject/GenericInjectionTest.java
+++ b/core/test/com/google/inject/GenericInjectionTest.java
@@ -16,8 +16,8 @@
 
 package com.google.inject;
 
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.util.Modules;
 import java.util.Arrays;
 import java.util.Collection;
diff --git a/core/test/com/google/inject/ImplicitBindingTest.java b/core/test/com/google/inject/ImplicitBindingTest.java
index 515635f..638db41 100644
--- a/core/test/com/google/inject/ImplicitBindingTest.java
+++ b/core/test/com/google/inject/ImplicitBindingTest.java
@@ -16,7 +16,7 @@
 
 package com.google.inject;
 
-import com.google.inject.internal.util.Iterables;
+import com.google.common.collect.Iterables;
 import java.util.List;
 
 import com.google.inject.name.Named;
diff --git a/core/test/com/google/inject/JitBindingsTest.java b/core/test/com/google/inject/JitBindingsTest.java
index 500c9dc..36dac10 100644
--- a/core/test/com/google/inject/JitBindingsTest.java
+++ b/core/test/com/google/inject/JitBindingsTest.java
@@ -20,7 +20,7 @@
 import static com.google.inject.JitBindingsTest.GetBindingCheck.ALLOW_BINDING_PROVIDER;
 import static com.google.inject.JitBindingsTest.GetBindingCheck.FAIL_ALL;
 import static com.google.inject.JitBindingsTest.GetBindingCheck.ALLOW_BINDING;
-import static com.google.inject.internal.util.ImmutableSet.of;
+import static com.google.common.collect.ImmutableSet.of;
 
 import junit.framework.TestCase;
 
diff --git a/core/test/com/google/inject/MethodInterceptionTest.java b/core/test/com/google/inject/MethodInterceptionTest.java
index 30fa574..e81faee 100644
--- a/core/test/com/google/inject/MethodInterceptionTest.java
+++ b/core/test/com/google/inject/MethodInterceptionTest.java
@@ -16,10 +16,10 @@
 
 package com.google.inject;
 
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Iterables;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import com.google.inject.matcher.AbstractMatcher;
 import com.google.inject.matcher.Matchers;
 import static com.google.inject.matcher.Matchers.only;
diff --git a/core/test/com/google/inject/NullableInjectionPointTest.java b/core/test/com/google/inject/NullableInjectionPointTest.java
index 1747ea9..59f6ab6 100644
--- a/core/test/com/google/inject/NullableInjectionPointTest.java
+++ b/core/test/com/google/inject/NullableInjectionPointTest.java
@@ -2,15 +2,12 @@
 
 import static com.google.inject.Asserts.assertContains;
 
-import java.lang.annotation.Annotation;
 import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import com.google.inject.internal.util.Nullable;
-
 import junit.framework.TestCase;
 
 /**
@@ -238,6 +235,11 @@
       this.foo = foo;
     }
   }
+
+  @Documented
+  @Retention(RetentionPolicy.RUNTIME)
+  @Target({ElementType.PARAMETER, ElementType.FIELD})
+  @interface Nullable { }
   
   static interface Namespace {
     @Documented
diff --git a/core/test/com/google/inject/OverrideModuleTest.java b/core/test/com/google/inject/OverrideModuleTest.java
index ede28b8..ff15539 100644
--- a/core/test/com/google/inject/OverrideModuleTest.java
+++ b/core/test/com/google/inject/OverrideModuleTest.java
@@ -20,7 +20,7 @@
 import static com.google.inject.Guice.createInjector;
 import static com.google.inject.name.Names.named;
 
-import com.google.inject.internal.util.Objects;
+import com.google.common.base.Objects;
 import com.google.inject.name.Named;
 import com.google.inject.util.Modules;
 import static java.lang.annotation.ElementType.TYPE;
diff --git a/core/test/com/google/inject/ParentInjectorTest.java b/core/test/com/google/inject/ParentInjectorTest.java
index d44fba2..e737c24 100644
--- a/core/test/com/google/inject/ParentInjectorTest.java
+++ b/core/test/com/google/inject/ParentInjectorTest.java
@@ -18,8 +18,8 @@
 
 import static com.google.inject.Asserts.assertContains;
 
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
 import com.google.inject.matcher.Matchers;
 import com.google.inject.name.Names;
 import com.google.inject.spi.TypeConverter;
diff --git a/core/test/com/google/inject/PrivateModuleTest.java b/core/test/com/google/inject/PrivateModuleTest.java
index 6353c65..0a6f84d 100644
--- a/core/test/com/google/inject/PrivateModuleTest.java
+++ b/core/test/com/google/inject/PrivateModuleTest.java
@@ -22,7 +22,7 @@
 import java.util.Collection;
 import java.util.List;
 
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import static com.google.inject.name.Names.named;
diff --git a/core/test/com/google/inject/ProvisionListenerTest.java b/core/test/com/google/inject/ProvisionListenerTest.java
index 69e6cc8..ff8c321 100644
--- a/core/test/com/google/inject/ProvisionListenerTest.java
+++ b/core/test/com/google/inject/ProvisionListenerTest.java
@@ -17,7 +17,7 @@
 package com.google.inject;

 

 import static com.google.inject.Asserts.assertContains;

-import static com.google.inject.internal.util.ImmutableList.of;

+import static com.google.common.collect.ImmutableList.of;

 import static com.google.inject.name.Names.named;

 

 import java.util.List;

@@ -25,8 +25,8 @@
 

 import junit.framework.TestCase;

 

-import com.google.inject.internal.util.ImmutableList;

-import com.google.inject.internal.util.Lists;

+import com.google.common.collect.ImmutableList;

+import com.google.common.collect.Lists;

 import com.google.inject.matcher.Matcher;

 import com.google.inject.matcher.Matchers;

 import com.google.inject.name.Named;

diff --git a/core/test/com/google/inject/ScopesTest.java b/core/test/com/google/inject/ScopesTest.java
index daa57a2..a7b2ba9 100644
--- a/core/test/com/google/inject/ScopesTest.java
+++ b/core/test/com/google/inject/ScopesTest.java
@@ -17,8 +17,8 @@
 package com.google.inject;
 
 import static com.google.inject.Asserts.assertContains;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
 import com.google.inject.name.Named;
 import static com.google.inject.name.Names.named;
 import com.google.inject.spi.Element;
diff --git a/core/test/com/google/inject/TypeConversionTest.java b/core/test/com/google/inject/TypeConversionTest.java
index 31f651d..ef24dfc 100644
--- a/core/test/com/google/inject/TypeConversionTest.java
+++ b/core/test/com/google/inject/TypeConversionTest.java
@@ -17,7 +17,7 @@
 package com.google.inject;
 
 import static com.google.inject.Asserts.assertContains;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.collect.Iterables;
 import com.google.inject.matcher.Matchers;
 import com.google.inject.spi.ConvertedConstantBinding;
 import com.google.inject.spi.TypeConverter;
diff --git a/core/test/com/google/inject/TypeListenerTest.java b/core/test/com/google/inject/TypeListenerTest.java
index 6ca8358..dfb2830 100644
--- a/core/test/com/google/inject/TypeListenerTest.java
+++ b/core/test/com/google/inject/TypeListenerTest.java
@@ -17,8 +17,8 @@
 package com.google.inject;
 
 import static com.google.inject.Asserts.assertContains;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import com.google.inject.matcher.Matcher;
 import com.google.inject.matcher.Matchers;
 import static com.google.inject.matcher.Matchers.any;
diff --git a/core/test/com/google/inject/TypeLiteralTest.java b/core/test/com/google/inject/TypeLiteralTest.java
index 7ed7359..e009d14 100644
--- a/core/test/com/google/inject/TypeLiteralTest.java
+++ b/core/test/com/google/inject/TypeLiteralTest.java
@@ -18,7 +18,7 @@
 
 import static com.google.inject.Asserts.assertEqualsBothWays;
 import static com.google.inject.Asserts.assertNotSerializable;
-import com.google.inject.internal.util.ImmutableList;
+import com.google.common.collect.ImmutableList;
 import com.google.inject.util.Types;
 import java.io.IOException;
 import java.lang.reflect.Type;
diff --git a/core/test/com/google/inject/TypeLiteralTypeResolutionTest.java b/core/test/com/google/inject/TypeLiteralTypeResolutionTest.java
index 7403709..6911a95 100644
--- a/core/test/com/google/inject/TypeLiteralTypeResolutionTest.java
+++ b/core/test/com/google/inject/TypeLiteralTypeResolutionTest.java
@@ -18,7 +18,7 @@
 
 import static com.google.inject.Asserts.assertEqualsBothWays;
 import static com.google.inject.Asserts.assertNotSerializable;
-import com.google.inject.internal.util.ImmutableList;
+import com.google.common.collect.ImmutableList;
 import com.google.inject.util.Types;
 import static com.google.inject.util.Types.arrayOf;
 import static com.google.inject.util.Types.listOf;
diff --git a/core/test/com/google/inject/internal/ProxyFactoryTest.java b/core/test/com/google/inject/internal/ProxyFactoryTest.java
index bcfa610..ab42b3e 100644
--- a/core/test/com/google/inject/internal/ProxyFactoryTest.java
+++ b/core/test/com/google/inject/internal/ProxyFactoryTest.java
@@ -22,7 +22,7 @@
 import static com.google.inject.matcher.Matchers.not;
 import static com.google.inject.matcher.Matchers.only;
 
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.InjectionPoint;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
diff --git a/core/test/com/google/inject/internal/util/FinalizableReferenceQueueTest.java b/core/test/com/google/inject/internal/util/FinalizableReferenceQueueTest.java
deleted file mode 100644
index bc1516b..0000000
--- a/core/test/com/google/inject/internal/util/FinalizableReferenceQueueTest.java
+++ /dev/null
@@ -1,147 +0,0 @@
-package com.google.inject.internal.util;
-
-import com.google.inject.internal.util.FinalizableReferenceQueue;
-import com.google.inject.internal.util.FinalizableWeakReference;
-import com.google.inject.internal.util.Finalizer;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-import java.net.URL;
-import java.net.URLClassLoader;
-import junit.framework.TestCase;
-
-/**
- * @author crazybob@google.com (Bob Lee)
- */
-public class FinalizableReferenceQueueTest extends TestCase {
-
-  private FinalizableReferenceQueue frq;
-
-  @Override
-  protected void tearDown() throws Exception {
-    frq = null;
-  }
-
-  public void testFinalizeReferentCalled() {
-    MockReference reference = new MockReference(
-        frq = new FinalizableReferenceQueue());
-    // wait up to 5s
-    for (int i = 0; i < 500; i++) {
-      if (reference.finalizeReferentCalled) {
-        return;
-      }
-      try {
-        System.gc();
-        Thread.sleep(10);
-      } catch (InterruptedException e) { /* ignore */ }
-    }
-    fail();
-  }
-
-  static class MockReference extends FinalizableWeakReference<Object> {
-
-    volatile boolean finalizeReferentCalled;
-
-    MockReference(FinalizableReferenceQueue frq) {
-      super(new Object(), frq);
-    }
-
-    public void finalizeReferent() {
-      finalizeReferentCalled = true;
-    }
-  }
-
-  /**
-   * Keeps a weak reference to the underlying reference queue. When this
-   * reference is cleared, we know that the background thread has stopped
-   * and released its strong reference.
-   */
-  private WeakReference<ReferenceQueue<Object>> queueReference;
-
-  public void testThatFinalizerStops() {
-    weaklyReferenceQueue();
-
-    // wait up to 5s
-    for (int i = 0; i < 500; i++) {
-      if (queueReference.get() == null) {
-        return;
-      }
-      try {
-        System.gc();
-        Thread.sleep(10);
-      } catch (InterruptedException e) { /* ignore */ }
-    }
-    fail();
-  }
-
-  /**
-   * If we don't keep a strong reference to the reference object, it won't
-   * be enqueued.
-   */
-  FinalizableWeakReference<Object> reference;
-
-  /**
-   * Create the FRQ in a method that goes out of scope so that we're sure
-   * it will be reclaimed.
-   */
-  private void weaklyReferenceQueue() {
-    frq = new FinalizableReferenceQueue();
-    queueReference = new WeakReference<ReferenceQueue<Object>>(frq.queue);
-
-    /*
-     * Queue and clear a reference for good measure. We test later on that
-     * the finalizer thread stopped, but we should test that it actually
-     * started first.
-     */
-    reference = new FinalizableWeakReference<Object>(new Object(), frq) {
-      public void finalizeReferent() {
-        reference = null;
-        frq = null;
-      }
-    };
-  }
-
-  public void testDecoupledLoader() {
-    FinalizableReferenceQueue.DecoupledLoader decoupledLoader =
-        new FinalizableReferenceQueue.DecoupledLoader() {
-          @Override
-          URLClassLoader newLoader(URL base) {
-            return new DecoupledClassLoader(new URL[] { base });
-          }
-        };
-
-    Class<?> finalizerCopy = decoupledLoader.loadFinalizer();
-
-    assertNotNull(finalizerCopy);
-    assertNotSame(Finalizer.class, finalizerCopy);
-
-    assertNotNull(FinalizableReferenceQueue.getStartFinalizer(finalizerCopy));
-  }
-
-  static class DecoupledClassLoader extends URLClassLoader {
-
-    public DecoupledClassLoader(URL[] urls) {
-      super(urls);
-    }
-
-    @Override
-    protected synchronized Class<?> loadClass(String name, boolean resolve)
-        throws ClassNotFoundException {
-      // Force Finalizer to load from this class loader, not its parent.
-      if (name.equals(Finalizer.class.getName())) {
-        Class<?> clazz = findClass(name);
-        if (resolve) {
-          resolveClass(clazz);
-        }
-        return clazz;
-      }
-
-      return super.loadClass(name, resolve);
-    }
-  }
-
-  public void testGetFinalizerUrl() {
-    assertNotNull(getClass().getResource(Finalizer.class.getSimpleName() + ".class"));
-  }
-}
-
-
diff --git a/core/test/com/google/inject/internal/util/ForwardingCollection.java b/core/test/com/google/inject/internal/util/ForwardingCollection.java
deleted file mode 100644
index 7e1e019..0000000
--- a/core/test/com/google/inject/internal/util/ForwardingCollection.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * A collection which forwards all its method calls to another collection.
- * Subclasses should override one or more methods to modify the behavior of
- * the backing collection as desired per the <a
- * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
- *
- * @see ForwardingObject
- * @author Kevin Bourrillion
- */
-public abstract class ForwardingCollection<E> extends ForwardingObject
-    implements Collection<E> {
-
-  @Override protected abstract Collection<E> delegate();
-
-  public Iterator<E> iterator() {
-    return delegate().iterator();
-  }
-
-  public int size() {
-    return delegate().size();
-  }
-
-  /**
-   * {@inheritDoc}
-   * 
-   * <p>This method always throws a {@link NullPointerException} when
-   * {@code collection} is null.  
-   */
-  public boolean removeAll(Collection<?> collection) {
-    return delegate().removeAll(checkNotNull(collection));
-  }
-
-  public boolean isEmpty() {
-    return delegate().isEmpty();
-  }
-
-  public boolean contains(Object object) {
-    return delegate().contains(object);
-  }
-
-  public Object[] toArray() {
-    return delegate().toArray();
-  }
-
-  public <T> T[] toArray(T[] array) {
-    return delegate().toArray(array);
-  }
-
-  public boolean add(E element) {
-    return delegate().add(element);
-  }
-
-  public boolean remove(Object object) {
-    return delegate().remove(object);
-  }
-
-  public boolean containsAll(Collection<?> collection) {
-    return delegate().containsAll(collection);
-  }
-
-  public boolean addAll(Collection<? extends E> collection) {
-    return delegate().addAll(collection);
-  }
-
-  /**
-   * {@inheritDoc}
-   * 
-   * <p>This method always throws a {@link NullPointerException} when
-   * {@code collection} is null.  
-   */
-  public boolean retainAll(Collection<?> collection) {
-    return delegate().retainAll(checkNotNull(collection));
-  }
-
-  public void clear() {
-    delegate().clear();
-  }
-}
diff --git a/core/test/com/google/inject/internal/util/ForwardingConcurrentMap.java b/core/test/com/google/inject/internal/util/ForwardingConcurrentMap.java
deleted file mode 100644
index f179af6..0000000
--- a/core/test/com/google/inject/internal/util/ForwardingConcurrentMap.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * A concurrent map which forwards all its method calls to another concurrent
- * map. Subclasses should override one or more methods to modify the behavior of
- * the backing map as desired per the <a
- * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
- *
- * @see ForwardingObject
- * @author Charles Fry
- */
-public abstract class ForwardingConcurrentMap<K, V> extends ForwardingMap<K, V>
-    implements ConcurrentMap<K, V> {
-
-  @Override protected abstract ConcurrentMap<K, V> delegate();
-
-  public V putIfAbsent(K key, V value) {
-    return delegate().putIfAbsent(key, value);
-  }
-
-  public boolean remove(Object key, Object value) {
-    return delegate().remove(key, value);
-  }
-
-  public V replace(K key, V value) {
-    return delegate().replace(key, value);
-  }
-
-  public boolean replace(K key, V oldValue, V newValue)  {
-    return delegate().replace(key, oldValue, newValue);
-  }
-
-}
diff --git a/core/test/com/google/inject/internal/util/ForwardingMap.java b/core/test/com/google/inject/internal/util/ForwardingMap.java
deleted file mode 100644
index 1031a55..0000000
--- a/core/test/com/google/inject/internal/util/ForwardingMap.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A map which forwards all its method calls to another map. Subclasses should
- * override one or more methods to modify the behavior of the backing map as
- * desired per the <a
- * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
- *
- * @see ForwardingObject
- * @author Kevin Bourrillion
- * @author Jared Levy
- */
-public abstract class ForwardingMap<K, V> extends ForwardingObject
-    implements Map<K, V> {
-
-  @Override protected abstract Map<K, V> delegate();
-
-  public int size() {
-    return delegate().size();
-  }
-
-  public boolean isEmpty() {
-    return delegate().isEmpty();
-  }
-
-  public V remove(Object object) {
-    return delegate().remove(object);
-  }
-
-  public void clear() {
-    delegate().clear();
-  }
-
-  public boolean containsKey(Object key) {
-    return delegate().containsKey(key);
-  }
-
-  public boolean containsValue(Object value) {
-    return delegate().containsValue(value);
-  }
-
-  public V get(Object key) {
-    return delegate().get(key);
-  }
-
-  public V put(K key, V value) {
-    return delegate().put(key, value);
-  }
-
-  public void putAll(Map<? extends K, ? extends V> map) {
-    delegate().putAll(map);
-  }
-
-  private transient Set<K> keySet;
-  
-  /**
-   * {@inheritDoc}
-   * 
-   * <p>The returned set's {@code removeAll} and {@code retainAll} methods
-   * always throw a {@link NullPointerException} when given a null collection.  
-   */
-  public Set<K> keySet() {
-    return (keySet == null) ? keySet = createKeySet() : keySet;
-  }
-
-  /**
-   * Generates a {@link Set} for use by {@link #keySet()}.
-   * 
-   * <p>ForwardingMap's implementation of keySet() calls this method to
-   * generate a collection of values, and then reuses that Set
-   * for subsequent invocations.  By default, this Set is essentially the
-   * result of invoking keySet() on the delegate.  Override this method if you
-   * want to provide another implementation.
-   * 
-   * @return A set for use by keySet().
-   */
-  protected Set<K> createKeySet() {
-    final Set<K> delegate = delegate().keySet();
-    return new ForwardingSet<K>() {
-      @Override protected Set<K> delegate() {
-        return delegate;
-      }
-    };
-  }
-  
-  private transient Collection<V> values;
-
-  /**
-   * {@inheritDoc}
-   * 
-   * <p>The returned collection's {@code removeAll} and {@code retainAll}
-   * methods always throw a {@link NullPointerException} when given a null
-   * collection.  
-   */
-  public Collection<V> values() {
-    return (values == null) ? values = createValues() : values;
-  }
-
-  /**
-   * Generates a {@link Collection} for use by {@link #values()}.
-   * 
-   * <p>ForwardingMap's implementation of {@code values()} calls this method to
-   * generate a collection of values, and then reuses that collection 
-   * for subsequent invocations.  By default, this collection is essentially the
-   * result of invoking values() on the delegate.  Override this method if you
-   * want to provide another implementation.
-   * 
-   * @return A set for use by values().
-   */
-  protected Collection<V> createValues() {
-    final Collection<V> delegate = delegate().values();
-    return new ForwardingCollection<V>() {
-      @Override protected Collection<V> delegate() {
-        return delegate;
-      }      
-    };
-  }
-  
-  private transient Set<Entry<K, V>> entrySet;
-  
-  /**
-   * {@inheritDoc}
-   * 
-   * <p>The returned set's {@code removeAll} and {@code retainAll} methods
-   * always throw a {@link NullPointerException} when given a null collection.  
-   */
-  public Set<Entry<K, V>> entrySet() {
-    return (entrySet == null) ? entrySet = createEntrySet() : entrySet;
-  }
-
-  /**
-   * Generates a {@link Set} for use by {@link #entrySet()}.
-   * 
-   * <p>ForwardingMap's implementation of entrySet() calls this method to
-   * generate a set of entries, and then reuses that set for subsequent
-   * invocations.  By default, this set is essentially the result of invoking
-   * entrySet() on the delegate.  Override this method if you want to 
-   * provide another implementation.
-   * 
-   * @return A set for use by entrySet().
-   */
-  protected Set<Entry<K, V>> createEntrySet() {
-    final Set<Entry<K, V>> delegate = delegate().entrySet();
-    return new ForwardingSet<Entry<K, V>>() {
-      @Override protected Set<Entry<K, V>> delegate() {
-        return delegate;
-      }
-    };
-  }
-
-  @Override public boolean equals(@Nullable Object object) {
-    return object == this || delegate().equals(object);
-  }
-
-  @Override public int hashCode() {
-    return delegate().hashCode();
-  }
-}
diff --git a/core/test/com/google/inject/internal/util/ForwardingObject.java b/core/test/com/google/inject/internal/util/ForwardingObject.java
deleted file mode 100644
index 74c6399..0000000
--- a/core/test/com/google/inject/internal/util/ForwardingObject.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.io.Serializable;
-
-/**
- * An abstract base class for implementing the <a
- * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
- * The {@link #delegate()} method must be overridden to return the instance
- * being decorated.
- *
- * This class does <i>not</i> forward the {@code hashCode} and {@code equals}
- * methods through to the backing object, but relies on {@code Object}'s
- * implementation. This is necessary to preserve the symmetry of {@code equals}.
- * Custom definitions of equality are usually based on an interface, such as
- * {@code Set} or {@code List}, so that the implementation of {@code equals} can
- * cast the object being tested for equality to the custom interface. {@code
- * ForwardingObject} implements no such custom interfaces directly; they
- * are implemented only in subclasses. Therefore, forwarding {@code equals}
- * would break symmetry, as the forwarding object might consider itself equal to
- * the object being tested, but the reverse could not be true. This behavior is
- * consistent with the JDK's collection wrappers, such as
- * {@link java.util.Collections#unmodifiableCollection}. Use an
- * interface-specific subclass of {@code ForwardingObject}, such as {@link
- * ForwardingList}, to preserve equality behavior, or override {@code equals}
- * directly.
- *
- * <p>The {@code toString} method is forwarded to the delegate. Although this
- * class does not implement {@link Serializable}, a serializable subclass may be
- * created since this class has a parameter-less constructor.
- *
- * @author Mike Bostock
- */
-public abstract class ForwardingObject {
-
-  /** Sole constructor. */
-  protected ForwardingObject() {}
-  
-  /**
-   * Returns the backing delegate instance that methods are forwarded to.
-   * Abstract subclasses generally override the {@link ForwardingObject} method
-   * with an abstract method that has a more specific return type, such as
-   * {@link ForwardingSet#delegate}. Concrete subclasses override this method to
-   * supply the instance being decorated.
-   */
-  protected abstract Object delegate();
-
-  /**
-   * Returns the string representation generated by the delegate's
-   * {@code toString} method.
-   */
-  @Override public String toString() {
-    return delegate().toString();
-  }
-  
-  /* No equals or hashCode. See class comments for details. */
-}
diff --git a/core/test/com/google/inject/internal/util/ForwardingSet.java b/core/test/com/google/inject/internal/util/ForwardingSet.java
deleted file mode 100644
index 368dd21..0000000
--- a/core/test/com/google/inject/internal/util/ForwardingSet.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-
-import java.util.Set;
-
-/**
- * A set which forwards all its method calls to another set. Subclasses should
- * override one or more methods to modify the behavior of the backing set as
- * desired per the <a
- * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
- *
- * @see ForwardingObject
- * @author Kevin Bourrillion
- */
-public abstract class ForwardingSet<E> extends ForwardingCollection<E>
-    implements Set<E> {
-
-  @Override protected abstract Set<E> delegate();
-
-  @Override public boolean equals(@Nullable Object object) {
-    return object == this || delegate().equals(object);
-  }
-
-  @Override public int hashCode() {
-    return delegate().hashCode();
-  }
-}
diff --git a/core/test/com/google/inject/internal/util/Jsr166HashMap.java b/core/test/com/google/inject/internal/util/Jsr166HashMap.java
deleted file mode 100644
index b65e62f..0000000
--- a/core/test/com/google/inject/internal/util/Jsr166HashMap.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package com.google.inject.internal.util;
-
-import com.google.inject.internal.util.ForwardingConcurrentMap;
-import com.google.inject.internal.util.CustomConcurrentHashMap;
-import java.io.Serializable;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * A copy of {@link java.util.concurrent.ConcurrentHashMap} used to test {@link
- * com.google.inject.internal.util.CustomConcurrentHashMap}. This also serves
- * as the examples in the CustomConcurrentHashMap Javadocs.
- */
-public class Jsr166HashMap<K, V> extends ForwardingConcurrentMap<K, V>
-    implements Serializable {
-
-  static class ConcurrentHashMapStrategy<K, V>
-      implements CustomConcurrentHashMap.Strategy<K, V,
-      InternalEntry<K, V>>, Serializable {
-    public InternalEntry<K, V> newEntry(K key, int hash,
-        InternalEntry<K, V> next) {
-      return new InternalEntry<K,V>(key, hash, null, next);
-    }
-    public InternalEntry<K, V> copyEntry(K key,
-        InternalEntry<K, V> original, InternalEntry<K, V> next) {
-      return new InternalEntry<K, V>(key, original.hash, original.value, next);
-    }
-    public void setValue(InternalEntry<K, V> entry, V value) {
-      entry.value = value;
-    }
-    public V getValue(InternalEntry<K, V> entry) { return entry.value; }
-    public boolean equalKeys(K a, Object b) { return a.equals(b); }
-    public boolean equalValues(V a, Object b) { return a.equals(b); }
-    public int hashKey(Object key) { return key.hashCode(); }
-    public K getKey(InternalEntry<K, V> entry) { return entry.key; }
-    public InternalEntry<K, V> getNext(InternalEntry<K, V> entry) {
-      return entry.next;
-    }
-    public int getHash(InternalEntry<K, V> entry) { return entry.hash; }
-    public void setInternals(CustomConcurrentHashMap.Internals<K, V,
-        InternalEntry<K, V>> internals) {} // ignored
-  }
-
-  static class InternalEntry<K, V> {
-    final K key;
-    final int hash;
-    final InternalEntry<K, V> next;
-    volatile V value;
-    InternalEntry(K key, int hash, V value, InternalEntry<K, V> next) {
-      this.key = key;
-      this.hash = hash;
-      this.value = value;
-      this.next = next;
-    }
-  }
-
-  /* ---------------- Public operations -------------- */
-
-  /**
-   * The default initial capacity for this table,
-   * used when not otherwise specified in a constructor.
-   */
-  static final int DEFAULT_INITIAL_CAPACITY = 16;
-
-  /**
-   * The default load factor for this table, used when not
-   * otherwise specified in a constructor.
-   */
-  static final float DEFAULT_LOAD_FACTOR = 0.75f;
-
-  /**
-   * The default concurrency level for this table, used when not
-   * otherwise specified in a constructor.
-   */
-  static final int DEFAULT_CONCURRENCY_LEVEL = 16;
-
-  final ConcurrentMap<K, V> delegate;
-
-  protected ConcurrentMap<K, V> delegate() {
-    return delegate;
-  }
-
-  /**
-   * Creates a new, empty map with the specified initial capacity, load factor
-   * and concurrency level.
-   *
-   * @param initialCapacity  the initial capacity. The implementation performs
-   *                         internal sizing to accommodate this many
-   *                         elements.
-   * @param loadFactor       the load factor threshold, used to control
-   *                         resizing. Resizing may be performed when the
-   *                         average number of elements per bin exceeds this
-   *                         threshold.
-   * @param concurrencyLevel the estimated number of concurrently updating
-   *                         threads. The implementation performs internal
-   *                         sizing to try to accommodate this many threads.
-   * @throws IllegalArgumentException if the initial capacity is negative or
-   *                                  the load factor or concurrencyLevel are
-   *                                  nonpositive.
-   */
-  public Jsr166HashMap(int initialCapacity,
-      float loadFactor, int concurrencyLevel) {
-    this.delegate = new CustomConcurrentHashMap.Builder()
-        .initialCapacity(initialCapacity)
-        .loadFactor(loadFactor)
-        .concurrencyLevel(concurrencyLevel)
-        .buildMap(new ConcurrentHashMapStrategy<K, V>());
-  }
-
-  /**
-   * Creates a new, empty map with the specified initial capacity and load
-   * factor and with the default concurrencyLevel (16).
-   *
-   * @param initialCapacity The implementation performs internal sizing to
-   *                        accommodate this many elements.
-   * @param loadFactor      the load factor threshold, used to control
-   *                        resizing. Resizing may be performed when the
-   *                        average number of elements per bin exceeds this
-   *                        threshold.
-   * @throws IllegalArgumentException if the initial capacity of elements is
-   *                                  negative or the load factor is
-   *                                  nonpositive
-   * @since 1.6
-   */
-  public Jsr166HashMap(int initialCapacity, float loadFactor) {
-    this(initialCapacity, loadFactor, DEFAULT_CONCURRENCY_LEVEL);
-  }
-
-  /**
-   * Creates a new, empty map with the specified initial capacity, and with
-   * default load factor (0.75) and concurrencyLevel (16).
-   *
-   * @param initialCapacity the initial capacity. The implementation performs
-   *                        internal sizing to accommodate this many
-   *                        elements.
-   * @throws IllegalArgumentException if the initial capacity of elements is
-   *                                  negative.
-   */
-  public Jsr166HashMap(int initialCapacity) {
-    this(initialCapacity, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL);
-  }
-
-  /**
-   * Creates a new, empty map with a default initial capacity (16), load
-   * factor (0.75) and concurrencyLevel (16).
-   */
-  public Jsr166HashMap() {
-    this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR,
-        DEFAULT_CONCURRENCY_LEVEL);
-  }
-
-  /**
-   * Creates a new map with the same mappings as the given map. The map is
-   * created with a capacity of 1.5 times the number of mappings in the given
-   * map or 16 (whichever is greater), and a default load factor (0.75) and
-   * concurrencyLevel (16).
-   *
-   * @param m the map
-   */
-  public Jsr166HashMap(Map<? extends K, ? extends V> m) {
-    this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1,
-        DEFAULT_INITIAL_CAPACITY),
-        DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL);
-    putAll(m);
-  }
-}
\ No newline at end of file
diff --git a/core/test/com/google/inject/internal/util/Jsr166HashMapTest.java b/core/test/com/google/inject/internal/util/Jsr166HashMapTest.java
deleted file mode 100644
index 6e6ed4f..0000000
--- a/core/test/com/google/inject/internal/util/Jsr166HashMapTest.java
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package com.google.inject.internal.util;
-
-import com.google.inject.internal.util.Jsr166HashMap;
-import junit.framework.TestCase;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * ConcurrentHashMap tests copied from ConcurrentHashMapTest. Useful as a
- * test case for CustomConcurrentHashMap.
- */
-public class Jsr166HashMapTest extends TestCase {
-
-    /*
-     * The following two methods and constants were copied from JSR166TestCase.
-     */
-
-    /**
-     * fail with message "should throw exception"
-     */
-    public void shouldThrow() {
-        fail("Should throw exception");
-    }
-
-    /**
-     * fail with message "Unexpected exception"
-     */
-    public void unexpectedException() {
-        fail("Unexpected exception");
-    }
-
-    static final Integer zero = new Integer(0);
-    static final Integer one = new Integer(1);
-    static final Integer two = new Integer(2);
-    static final Integer three = new Integer(3);
-    static final Integer four = new Integer(4);
-    static final Integer five = new Integer(5);
-    static final Integer six = new Integer(6);
-    static final Integer seven = new Integer(7);
-    static final Integer eight = new Integer(8);
-    static final Integer nine = new Integer(9);
-    static final Integer m1 = new Integer(-1);
-    static final Integer m2 = new Integer(-2);
-    static final Integer m3 = new Integer(-3);
-    static final Integer m4 = new Integer(-4);
-    static final Integer m5 = new Integer(-5);
-    static final Integer m6 = new Integer(-6);
-    static final Integer m10 = new Integer(-10);
-
-    /**
-     * Create a map from Integers 1-5 to Strings "A"-"E".
-     */
-    private static Jsr166HashMap map5() {
-        Jsr166HashMap map = new Jsr166HashMap(5);
-        assertTrue(map.isEmpty());
-        map.put(one, "A");
-        map.put(two, "B");
-        map.put(three, "C");
-        map.put(four, "D");
-        map.put(five, "E");
-        assertFalse(map.isEmpty());
-        assertEquals(5, map.size());
-        return map;
-    }
-
-    /**
-     * clear removes all pairs
-     */
-    public void testClear() {
-        Jsr166HashMap map = map5();
-        map.clear();
-        assertEquals(map.size(), 0);
-    }
-
-    /**
-     * Maps with same contents are equal
-     */
-    public void testEquals() {
-        Jsr166HashMap map1 = map5();
-        Jsr166HashMap map2 = map5();
-        assertEquals(map1, map2);
-        assertEquals(map2, map1);
-        map1.clear();
-        assertFalse(map1.equals(map2));
-        assertFalse(map2.equals(map1));
-    }
-
-    /**
-     * containsKey returns true for contained key
-     */
-    public void testContainsKey() {
-        Jsr166HashMap map = map5();
-        assertTrue(map.containsKey(one));
-        assertFalse(map.containsKey(zero));
-    }
-
-    /**
-     * containsValue returns true for held values
-     */
-    public void testContainsValue() {
-        Jsr166HashMap map = map5();
-        assertTrue(map.containsValue("A"));
-        assertFalse(map.containsValue("Z"));
-    }
-
-    /**
-     * get returns the correct element at the given key, or null if not present
-     */
-    public void testGet() {
-        Jsr166HashMap map = map5();
-        assertEquals("A", (String) map.get(one));
-        Jsr166HashMap empty = new Jsr166HashMap();
-        assertNull(map.get("anything"));
-    }
-
-    /**
-     * isEmpty is true of empty map and false for non-empty
-     */
-    public void testIsEmpty() {
-        Jsr166HashMap empty = new Jsr166HashMap();
-        Jsr166HashMap map = map5();
-        assertTrue(empty.isEmpty());
-        assertFalse(map.isEmpty());
-    }
-
-    /**
-     * keySet returns a Set containing all the keys
-     */
-    public void testKeySet() {
-        Jsr166HashMap map = map5();
-        Set s = map.keySet();
-        assertEquals(5, s.size());
-        assertTrue(s.contains(one));
-        assertTrue(s.contains(two));
-        assertTrue(s.contains(three));
-        assertTrue(s.contains(four));
-        assertTrue(s.contains(five));
-    }
-
-    /**
-     * keySet.toArray returns contains all keys
-     */
-    public void testKeySetToArray() {
-        Jsr166HashMap map = map5();
-        Set s = map.keySet();
-        Object[] ar = s.toArray();
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        assertEquals(5, ar.length);
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     * Values.toArray contains all values
-     */
-    public void testValuesToArray() {
-        Jsr166HashMap map = map5();
-        Collection v = map.values();
-        Object[] ar = v.toArray();
-        ArrayList s = new ArrayList(Arrays.asList(ar));
-        assertEquals(5, ar.length);
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     * entrySet.toArray contains all entries
-     */
-    public void testEntrySetToArray() {
-        Jsr166HashMap map = map5();
-        Set s = map.entrySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        for (int i = 0; i < 5; ++i) {
-            assertTrue(map.containsKey(((Map.Entry) (ar[i])).getKey()));
-            assertTrue(map.containsValue(((Map.Entry) (ar[i])).getValue()));
-        }
-    }
-
-    /**
-     * values collection contains all values
-     */
-    public void testValues() {
-        Jsr166HashMap map = map5();
-        Collection s = map.values();
-        assertEquals(5, s.size());
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     * entrySet contains all pairs
-     */
-    public void testEntrySet() {
-        Jsr166HashMap map = map5();
-        Set s = map.entrySet();
-        assertEquals(5, s.size());
-        Iterator it = s.iterator();
-        while (it.hasNext()) {
-            Map.Entry e = (Map.Entry) it.next();
-            assertTrue(
-                    (e.getKey().equals(one) && e.getValue().equals("A")) ||
-                            (e.getKey().equals(two) && e.getValue().equals("B"))
-                            ||
-                            (e.getKey().equals(three) && e.getValue()
-                                    .equals("C")) ||
-                            (e.getKey().equals(four) && e.getValue()
-                                    .equals("D")) ||
-                            (e.getKey().equals(five) && e.getValue()
-                                    .equals("E")));
-        }
-    }
-
-    /**
-     * putAll  adds all key-value pairs from the given map
-     */
-    public void testPutAll() {
-        Jsr166HashMap empty = new Jsr166HashMap();
-        Jsr166HashMap map = map5();
-        empty.putAll(map);
-        assertEquals(5, empty.size());
-        assertTrue(empty.containsKey(one));
-        assertTrue(empty.containsKey(two));
-        assertTrue(empty.containsKey(three));
-        assertTrue(empty.containsKey(four));
-        assertTrue(empty.containsKey(five));
-    }
-
-    /**
-     * putIfAbsent works when the given key is not present
-     */
-    public void testPutIfAbsent() {
-        Jsr166HashMap map = map5();
-        map.putIfAbsent(six, "Z");
-        assertTrue(map.containsKey(six));
-    }
-
-    /**
-     * putIfAbsent does not add the pair if the key is already present
-     */
-    public void testPutIfAbsent2() {
-        Jsr166HashMap map = map5();
-        assertEquals("A", map.putIfAbsent(one, "Z"));
-    }
-
-    /**
-     * replace fails when the given key is not present
-     */
-    public void testReplace() {
-        Jsr166HashMap map = map5();
-        assertNull(map.replace(six, "Z"));
-        assertFalse(map.containsKey(six));
-    }
-
-    /**
-     * replace succeeds if the key is already present
-     */
-    public void testReplace2() {
-        Jsr166HashMap map = map5();
-        assertNotNull(map.replace(one, "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     * replace value fails when the given key not mapped to expected value
-     */
-    public void testReplaceValue() {
-        Jsr166HashMap map = map5();
-        assertEquals("A", map.get(one));
-        assertFalse(map.replace(one, "Z", "Z"));
-        assertEquals("A", map.get(one));
-    }
-
-    /**
-     * replace value succeeds when the given key mapped to expected value
-     */
-    public void testReplaceValue2() {
-        Jsr166HashMap map = map5();
-        assertEquals("A", map.get(one));
-        assertTrue(map.replace(one, "A", "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     * remove removes the correct key-value pair from the map
-     */
-    public void testRemove() {
-        Jsr166HashMap map = map5();
-        map.remove(five);
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-    }
-
-    /**
-     * remove(key,value) removes only if pair present
-     */
-    public void testRemove2() {
-        Jsr166HashMap map = map5();
-        map.remove(five, "E");
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-        map.remove(four, "A");
-        assertEquals(4, map.size());
-        assertTrue(map.containsKey(four));
-
-    }
-
-    /**
-     * size returns the correct values
-     */
-    public void testSize() {
-        Jsr166HashMap map = map5();
-        Jsr166HashMap empty = new Jsr166HashMap();
-        assertEquals(0, empty.size());
-        assertEquals(5, map.size());
-    }
-
-    /**
-     * toString contains toString of elements
-     */
-    public void testToString() {
-        Jsr166HashMap map = map5();
-        String s = map.toString();
-        for (int i = 1; i <= 5; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    // Exception tests
-
-    /**
-     * Cannot create with negative capacity
-     */
-    public void testConstructor1() {
-        try {
-            new Jsr166HashMap(-1, 0, 1);
-            shouldThrow();
-        } catch (IllegalArgumentException e) {
-        }
-    }
-
-    /**
-     * Cannot create with negative concurrency level
-     */
-    public void testConstructor2() {
-        try {
-            new Jsr166HashMap(1, 0, -1);
-            shouldThrow();
-        } catch (IllegalArgumentException e) {
-        }
-    }
-
-    /**
-     * Cannot create with only negative capacity
-     */
-    public void testConstructor3() {
-        try {
-            new Jsr166HashMap(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException e) {
-        }
-    }
-
-    /**
-     * get(null) throws NPE
-     */
-    public void testGet_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.get(null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * containsKey(null) throws NPE
-     */
-    public void testContainsKey_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.containsKey(null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * containsValue(null) throws NPE
-     */
-    public void testContainsValue_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.containsValue(null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * put(null,x) throws NPE
-     */
-    public void testPut1_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.put(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * put(x, null) throws NPE
-     */
-    public void testPut2_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.put("whatever", null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * putIfAbsent(null, x) throws NPE
-     */
-    public void testPutIfAbsent1_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.putIfAbsent(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * replace(null, x) throws NPE
-     */
-    public void testReplace_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.replace(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * replace(null, x, y) throws NPE
-     */
-    public void testReplaceValue_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.replace(null, one, "whatever");
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * putIfAbsent(x, null) throws NPE
-     */
-    public void testPutIfAbsent2_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.putIfAbsent("whatever", null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-
-    /**
-     * replace(x, null) throws NPE
-     */
-    public void testReplace2_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.replace("whatever", null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * replace(x, null, y) throws NPE
-     */
-    public void testReplaceValue2_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.replace("whatever", null, "A");
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * replace(x, y, null) throws NPE
-     */
-    public void testReplaceValue3_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.replace("whatever", one, null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-
-    /**
-     * remove(null) throws NPE
-     */
-    public void testRemove1_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.put("sadsdf", "asdads");
-            c.remove(null);
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * remove(null, x) throws NPE
-     */
-    public void testRemove2_NullPointerException() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.put("sadsdf", "asdads");
-            c.remove(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * remove(x, null) returns false
-     */
-    public void testRemove3() {
-        try {
-            Jsr166HashMap c = new Jsr166HashMap(5);
-            c.put("sadsdf", "asdads");
-            assertFalse(c.remove("sadsdf", null));
-        } catch (NullPointerException e) {
-            fail();
-        }
-    }
-
-    /**
-     * A deserialized map equals original
-     */
-    public void testSerialization() {
-        Jsr166HashMap q = map5();
-
-        try {
-            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-            ObjectOutputStream out =
-                    new ObjectOutputStream(new BufferedOutputStream(bout));
-            out.writeObject(q);
-            out.close();
-
-            ByteArrayInputStream bin =
-                    new ByteArrayInputStream(bout.toByteArray());
-            ObjectInputStream in =
-                    new ObjectInputStream(new BufferedInputStream(bin));
-            Jsr166HashMap r = (Jsr166HashMap) in.readObject();
-            assertEquals(q.size(), r.size());
-            assertTrue(q.equals(r));
-            assertTrue(r.equals(q));
-        } catch (Exception e) {
-            e.printStackTrace();
-            unexpectedException();
-        }
-    }
-
-
-    /**
-     * SetValue of an EntrySet entry sets value in the map.
-     */
-    public void testSetValueWriteThrough() {
-        // Adapted from a bug report by Eric Zoerner
-        Jsr166HashMap map = new Jsr166HashMap(2, 5.0f, 1);
-        assertTrue(map.isEmpty());
-        for (int i = 0; i < 20; i++) {
-            map.put(new Integer(i), new Integer(i));
-        }
-        assertFalse(map.isEmpty());
-        Map.Entry entry1 = (Map.Entry) map.entrySet().iterator().next();
-
-        // assert that entry1 is not 16
-        assertTrue("entry is 16, test not valid",
-                !entry1.getKey().equals(new Integer(16)));
-
-        // remove 16 (a different key) from map
-        // which just happens to cause entry1 to be cloned in map
-        map.remove(new Integer(16));
-        entry1.setValue("XYZ");
-        assertTrue(map.containsValue("XYZ")); // fails
-    }
-
-}
diff --git a/core/test/com/google/inject/internal/util/MapMakerTestSuite.java b/core/test/com/google/inject/internal/util/MapMakerTestSuite.java
deleted file mode 100644
index e04e5d9..0000000
--- a/core/test/com/google/inject/internal/util/MapMakerTestSuite.java
+++ /dev/null
@@ -1,1211 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import com.google.inject.internal.util.ComputationException;
-import com.google.inject.internal.util.CustomConcurrentHashMap.Impl;
-import com.google.inject.internal.util.ExpirationTimer;
-import com.google.inject.internal.util.MapMaker;
-import com.google.inject.internal.util.Maps;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import static java.util.concurrent.TimeUnit.NANOSECONDS;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit tests for MapMaker. Also less directly serves as the test suite for
- * CustomConcurrentHashMap.
- */
-public class MapMakerTestSuite extends TestCase {
-
-  public static Test suite() {
-    TestSuite suite = new TestSuite();
-
-    suite.addTestSuite(MakerTest.class);
-    suite.addTestSuite(RecursiveComputationTest.class);
-    suite.addTestSuite(ReferenceMapTest.class);
-    suite.addTestSuite(ComputingTest.class);
-    suite.addTest(ReferenceCombinationTestSuite.suite());
-    suite.addTestSuite(ExpiringReferenceMapTest.class);
-    suite.addTestSuite(ExpiringComputingReferenceMapTest.class);
-
-    return suite;
-  }
-
-  public static class MakerTest extends TestCase {
-    public void testSizingDefaults() {
-      Impl<?, ?, ?> map = makeCustomMap(new MapMaker());
-      assertEquals(16, map.segments.length); // concurrency level
-      assertEquals(1, map.segments[0].table.length()); // capacity / conc level
-      assertEquals(0.75f, map.loadFactor);
-    }
-
-    public void testInitialCapacity_small() {
-      MapMaker maker = new MapMaker().initialCapacity(17);
-      Impl<?, ?, ?> map = makeCustomMap(maker);
-
-      assertEquals(2, map.segments[0].table.length());
-    }
-
-    public void testInitialCapacity_smallest() {
-      MapMaker maker = new MapMaker().initialCapacity(0);
-      Impl<?, ?, ?> map = makeCustomMap(maker);
-
-      // 1 is as low as it goes, not 0. it feels dirty to know this/test this.
-      assertEquals(1, map.segments[0].table.length());
-    }
-
-    public void testInitialCapacity_large() {
-      new MapMaker().initialCapacity(Integer.MAX_VALUE);
-      // that the maker didn't blow up is enough;
-      // don't actually create this monster!
-    }
-
-    public void testInitialCapacity_negative() {
-      MapMaker maker = new MapMaker();
-      try {
-        maker.initialCapacity(-1);
-        fail();
-      } catch (IllegalArgumentException expected) {
-      }
-    }
-
-    // TODO: enable when ready
-    public void xtestInitialCapacity_setTwice() {
-      MapMaker maker = new MapMaker().initialCapacity(16);
-      try {
-        // even to the same value is not allowed
-        maker.initialCapacity(16);
-        fail();
-      } catch (IllegalArgumentException expected) {
-      }
-    }
-
-    public void testLoadFactor_small() {
-      MapMaker maker = new MapMaker().loadFactor(Float.MIN_VALUE);
-      Impl<?, ?, ?> map = makeCustomMap(maker);
-      assertEquals(Float.MIN_VALUE, map.loadFactor);
-
-      // has no other effect until we add an entry (which would be bad)
-      assertEquals(1, map.segments[0].table.length());
-    }
-
-    public void testLoadFactor_large() {
-      MapMaker maker = new MapMaker().loadFactor(Float.MAX_VALUE);
-      Impl<?, ?, ?> map = makeCustomMap(maker);
-      assertEquals(Float.MAX_VALUE, map.loadFactor);
-
-      // these tables will never grow... we could add a ton of entries to
-      // check that if we wanted to.
-      assertEquals(1, map.segments[0].table.length());
-    }
-
-    public void testLoadFactor_zero() {
-      MapMaker maker = new MapMaker();
-      try {
-        maker.loadFactor(0);
-        fail();
-      } catch (IllegalArgumentException expected) {
-      }
-    }
-
-    // TODO: enable when ready
-    public void xtestLoadFactor_setTwice() {
-      MapMaker maker = new MapMaker().loadFactor(0.75f);
-      try {
-        // even to the same value is not allowed
-        maker.loadFactor(0.75f);
-        fail();
-      } catch (IllegalArgumentException expected) {
-      }
-    }
-
-    public void testConcurrencyLevel_small() {
-      MapMaker maker = new MapMaker().concurrencyLevel(1);
-      Impl<?, ?, ?> map = makeCustomMap(maker);
-      assertEquals(1, map.segments.length);
-    }
-
-    public void testConcurrencyLevel_large() {
-      new MapMaker().concurrencyLevel(Integer.MAX_VALUE);
-      // don't actually build this beast
-    }
-
-    public void testConcurrencyLevel_zero() {
-      MapMaker maker = new MapMaker();
-      try {
-        maker.concurrencyLevel(0);
-        fail();
-      } catch (IllegalArgumentException expected) {
-      }
-    }
-
-    // TODO: enable when ready
-    public void xtestConcurrencyLevel_setTwice() {
-      MapMaker maker = new MapMaker().concurrencyLevel(16);
-      try {
-        // even to the same value is not allowed
-        maker.concurrencyLevel(16);
-        fail();
-      } catch (IllegalArgumentException expected) {
-      }
-    }
-
-    public void testKeyStrengthSetTwice() {
-      MapMaker maker1 = new MapMaker().weakKeys();
-      try {
-        maker1.weakKeys();
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-
-      MapMaker maker2 = new MapMaker().softKeys();
-      try {
-        maker2.softKeys();
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-
-      MapMaker maker3 = new MapMaker().weakKeys();
-      try {
-        maker3.softKeys();
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-    }
-
-    public void testValueStrengthSetTwice() {
-      MapMaker maker1 = new MapMaker().weakValues();
-      try {
-        maker1.weakValues();
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-
-      MapMaker maker2 = new MapMaker().softValues();
-      try {
-        maker2.softValues();
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-
-      MapMaker maker3 = new MapMaker().weakValues();
-      try {
-        maker3.softValues();
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-    }
-
-    public void testExpiration_small() {
-      new MapMaker().expiration(1, NANOSECONDS);
-      // well, it didn't blow up.
-    }
-
-    public void testExpiration_setTwice() {
-      MapMaker maker = new MapMaker().expiration(3600, SECONDS);
-      try {
-        // even to the same value is not allowed
-        maker.expiration(3600, SECONDS);
-        fail();
-      } catch (IllegalStateException expected) {
-      }
-    }
-
-    public void testReturnsPlainConcurrentHashMapWhenPossible() {
-      Map<?, ?> map = new MapMaker()
-          .concurrencyLevel(5)
-          .loadFactor(0.5f)
-          .initialCapacity(5)
-          .makeMap();
-      assertTrue(map instanceof ConcurrentHashMap);
-    }
-
-    private static Impl<?, ?, ?> makeCustomMap(MapMaker maker) {
-      // Use makeComputingMap() to force it to return CCHM.Impl, not
-      // ConcurrentHashMap.
-      return (Impl<?, ?, ?>) maker.makeComputingMap(new Function<Object, Object>() {
-        public Object apply(@Nullable Object from) {
-          return from;
-        }
-      });
-    }
-  }
-
-  public static class RecursiveComputationTest extends TestCase {
-
-    Function<Integer, String> recursiveComputer
-        = new Function<Integer, String>() {
-      public String apply(Integer key) {
-        if (key > 0) {
-          return key + ", " + recursiveMap.get(key - 1);
-        } else {
-          return "0";
-        }
-      }
-    };
-
-    ConcurrentMap<Integer, String> recursiveMap = new MapMaker()
-        .weakKeys()
-        .weakValues()
-        .makeComputingMap(recursiveComputer);
-
-    public void testRecursiveComputation() {
-      assertEquals("3, 2, 1, 0", recursiveMap.get(3));
-    }
-  }
-
-  /**
-   * Tests for basic map functionality.
-   */
-  public static class ReferenceMapTest extends TestCase {
-
-    public void testValueCleanupWithWeakKey() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().weakKeys().makeMap();
-      map.put(new Object(), new Object());
-      assertCleanup(map);
-    }
-
-    public void testValueCleanupWithSoftKey() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().softKeys().makeMap();
-      map.put(new Object(), new Object());
-      assertCleanup(map);
-    }
-
-    public void testKeyCleanupWithWeakValue() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().weakValues().makeMap();
-      map.put(new Object(), new Object());
-      assertCleanup(map);
-    }
-
-    public void testKeyCleanupWithSoftValue() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().softValues().makeMap();
-      map.put(new Object(), new Object());
-      assertCleanup(map);
-    }
-
-    public void testInternedValueCleanupWithWeakKey() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().weakKeys().makeMap();
-      map.put(new Integer(5), "foo");
-      assertCleanup(map);
-    }
-
-    public void testInternedValueCleanupWithSoftKey() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().softKeys().makeMap();
-      map.put(new Integer(5), "foo");
-      assertCleanup(map);
-    }
-
-    public void testInternedKeyCleanupWithWeakValue() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().weakValues().makeMap();
-      map.put(5, new String("foo"));
-      assertCleanup(map);
-    }
-
-    public void testInternedKeyCleanupWithSoftValue() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().softValues().makeMap();
-      map.put(5, new String("foo"));
-      assertCleanup(map);
-    }
-
-    public void testReplace() {
-      ConcurrentMap<Object, Object> map =
-          new MapMaker().makeMap();
-      assertNull(map.replace("one", 1));
-    }
-
-    private static void assertCleanup(ConcurrentMap<?, ?> map) {
-      assertEquals(1, map.size());
-
-      // wait up to 5s
-      byte[] filler = new byte[1024];
-      for (int i = 0; i < 500; i++) {
-        System.gc();
-        if (map.isEmpty()) {
-          return;
-        }
-        try {
-          Thread.sleep(10);
-        } catch (InterruptedException e) { /* ignore */ }
-        try {
-          // Fill up heap so soft references get cleared.
-          filler = new byte[filler.length * 2];
-        } catch (OutOfMemoryError e) {}
-      }
-
-      fail();
-    }
-
-    public void testWeakKeyIdentityLookup() {
-      ConcurrentMap<Integer, String> map =
-          new MapMaker().weakKeys().makeMap();
-      Integer key1 = new Integer(12357);
-      Integer key2 = new Integer(12357);
-      map.put(key1, "a");
-      assertTrue(map.containsKey(key1));
-      assertFalse(map.containsKey(key2));
-    }
-
-    public void testSoftKeyIdentityLookup() {
-      ConcurrentMap<Integer, String> map =
-          new MapMaker().softKeys().makeMap();
-      Integer key1 = new Integer(12357);
-      Integer key2 = new Integer(12357);
-      map.put(key1, "a");
-      assertTrue(map.containsKey(key1));
-      assertFalse(map.containsKey(key2));
-    }
-
-    public void testWeakValueIdentityLookup() {
-      ConcurrentMap<String, Integer> map =
-          new MapMaker().weakValues().makeMap();
-      Integer value1 = new Integer(12357);
-      Integer value2 = new Integer(12357);
-      map.put("a", value1);
-      assertTrue(map.containsValue(value1));
-      assertFalse(map.containsValue(value2));
-    }
-
-    public void testSoftValueIdentityLookup() {
-      ConcurrentMap<String, Integer> map =
-          new MapMaker().softValues().makeMap();
-      Integer value1 = new Integer(12357);
-      Integer value2 = new Integer(12357);
-      map.put("a", value1);
-      assertTrue(map.containsValue(value1));
-      assertFalse(map.containsValue(value2));
-    }
-
-    public void testWeakKeyEntrySetRemove() {
-      ConcurrentMap<Integer, String> map =
-          new MapMaker().weakKeys().makeMap();
-      Integer key1 = new Integer(12357);
-      Integer key2 = new Integer(12357);
-      map.put(key1, "a");
-      assertFalse(map.entrySet().remove(Maps.immutableEntry(key2, "a")));
-      assertEquals(1, map.size());
-      assertTrue(map.entrySet().remove(Maps.immutableEntry(key1, "a")));
-      assertEquals(0, map.size());
-    }
-
-    public void testEntrySetIteratorRemove() {
-      ConcurrentMap<String, Integer> map =
-          new MapMaker().makeMap();
-      map.put("foo", 1);
-      map.put("bar", 2);
-      assertEquals(2, map.size());
-      Iterator<Map.Entry<String, Integer>> iterator = map.entrySet().iterator();
-      try {
-        iterator.remove();
-        fail();
-      } catch (IllegalStateException expected) {}
-      iterator.next();
-      iterator.remove();
-      assertEquals(1, map.size());
-      try {
-        iterator.remove();
-        fail();
-      } catch (IllegalStateException expected) {}
-      iterator.next();
-      iterator.remove();
-      assertEquals(0, map.size());
-    }
-  }
-
-  /**
-   * Tests for computing functionality.
-   */
-  public static class ComputingTest extends TestCase {
-
-    public void testComputerThatReturnsNull() {
-      ConcurrentMap<Integer, String> map = new MapMaker()
-          .makeComputingMap(new Function<Integer, String>() {
-            public String apply(Integer key) {
-              return null;
-            }
-          });
-      try {
-        map.get(1);
-        fail();
-      } catch (NullPointerException e) { /* expected */ }
-    }
-
-    public void testRecomputeAfterReclamation()
-        throws InterruptedException {
-      ConcurrentMap<Integer, String> map = new MapMaker()
-          .weakValues()
-          .makeComputingMap(new Function<Integer, String>() {
-            @SuppressWarnings("RedundantStringConstructorCall")
-            public String apply(Integer key) {
-              return new String("one");
-            }
-          });
-
-      for (int i = 0; i < 10; i++) {
-        // The entry should get garbage collected and recomputed.
-        assertEquals("on iteration " + i, "one", map.get(1));
-        Thread.sleep(i);
-        System.gc();
-      }
-    }
-
-    public void testRuntimeException() {
-      final RuntimeException e = new RuntimeException();
-
-      ConcurrentMap<Object, Object> map = new MapMaker().makeComputingMap(
-          new Function<Object, Object>() {
-        public Object apply(Object from) {
-          throw e;
-        }
-      });
-
-      try {
-        map.get(new Object());
-        fail();
-      } catch (ComputationException ce) {
-        assertSame(e, ce.getCause());
-      }
-    }
-
-    public void testSleepConcurrency() throws InterruptedException {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .weakKeys().weakValues().makeComputingMap(new SleepFunction());
-      assertConcurrency(cache, false);
-    }
-
-    public void testBusyConcurrency() throws InterruptedException {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .weakKeys().weakValues().makeComputingMap(new BusyFunction());
-      assertConcurrency(cache, false);
-    }
-
-    public void testFastConcurrency() throws InterruptedException {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .weakKeys().weakValues().makeComputingMap(new SomeFunction());
-      assertConcurrency(cache, false);
-    }
-
-    public void testSleepCanonical() throws InterruptedException {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .softValues().makeComputingMap(new SleepFunction());
-      assertConcurrency(cache, true);
-    }
-
-    public void testBusyCanonical() throws InterruptedException {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .softValues().makeComputingMap(new BusyFunction());
-      assertConcurrency(cache, true);
-    }
-
-    public void testFastCanonical() throws InterruptedException {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .softValues().makeComputingMap(new SomeFunction());
-      assertConcurrency(cache, true);
-    }
-
-    private static void assertConcurrency(
-        final ConcurrentMap<String, Integer> cache,
-        final boolean simulateAliasing) throws InterruptedException {
-      final int n = 20;
-      final CountDownLatch startSignal = new CountDownLatch(1);
-      final CountDownLatch doneSignal = new CountDownLatch(n);
-      for (int i = 0; i < n; i++) {
-        new Thread() {
-          @Override public void run() {
-            try {
-              startSignal.await();
-              for (int j = 0; j < n; j++) {
-                cache.get(simulateAliasing ? new String("foo") : "foo");
-              }
-              doneSignal.countDown();
-            } catch (InterruptedException ignored) {}
-          }
-        }.start();
-      }
-
-      startSignal.countDown();
-      doneSignal.await();
-      assertEquals(Integer.valueOf(1), cache.get("foo"));
-      assertEquals(Integer.valueOf(2), cache.get("bar"));
-    }
-
-    private static class SomeFunction implements Function<String, Integer> {
-      private int numApplies = 0;
-      public Integer apply(String s) {
-        return ++numApplies;
-      }
-    }
-
-    private static class SleepFunction implements Function<String, Integer> {
-      private int numApplies = 0;
-      public Integer apply(String s) {
-        try {
-          Thread.sleep(100);
-        } catch (InterruptedException e) {
-          throw new RuntimeException(e);
-        }
-        return ++numApplies;
-      }
-    }
-
-    private static class BusyFunction implements Function<String, Integer> {
-      private int numApplies = 0;
-      public Integer apply(String s) {
-        for (int i = 0; i < 1000; i++) {
-          Math.sqrt(i);
-        }
-        return ++numApplies;
-      }
-    }
-  }
-
-  /**
-   * Tests combinations of key and value reference types.
-   */
-  public static class ReferenceCombinationTestSuite extends TestCase {
-
-    interface BuilderOption {
-      void applyTo(MapMaker maker);
-    }
-
-    public static Test suite() {
-      TestSuite suite = new TestSuite();
-
-      BuilderOption[] keyOptions = {
-        new BuilderOption() {
-          public void applyTo(MapMaker maker) {
-            // strong keys
-          }
-          @Override public String toString() {
-            return "Strong";
-          }
-        },
-        new BuilderOption() {
-          public void applyTo(MapMaker maker) {
-            maker.weakKeys();
-          }
-          @Override public String toString() {
-            return "Weak";
-          }
-        },
-        new BuilderOption() {
-          public void applyTo(MapMaker maker) {
-            maker.softKeys();
-          }
-          @Override public String toString() {
-            return "Soft";
-          }
-        },
-      };
-
-      BuilderOption[] valueOptions = {
-        new BuilderOption() {
-          public void applyTo(MapMaker maker) {
-            // strong values
-          }
-          @Override public String toString() {
-            return "Strong";
-          }
-        },
-        new BuilderOption() {
-          public void applyTo(MapMaker maker) {
-            maker.weakValues();
-          }
-          @Override public String toString() {
-            return "Weak";
-          }
-        },
-        new BuilderOption() {
-          public void applyTo(MapMaker maker) {
-            maker.softValues();
-          }
-          @Override public String toString() {
-            return "Soft";
-          }
-        },
-      };
-
-      // create test cases for each key and value type.
-      for (Method method : MapTest.class.getMethods()) {
-        String name = method.getName();
-        if (name.startsWith("test")) {
-          for (BuilderOption keyOption : keyOptions) {
-            for (BuilderOption valueOption : valueOptions) {
-              suite.addTest(new MapTest(name, keyOption, valueOption));
-            }
-          }
-        }
-      }
-
-      return suite;
-    }
-
-    public static class MapTest extends TestCase {
-
-      final BuilderOption keyOption;
-      final BuilderOption valueOption;
-
-      public MapTest(String name,
-          BuilderOption keyOption,
-          BuilderOption valueOption) {
-        super(name);
-        this.keyOption = keyOption;
-        this.valueOption = valueOption;
-      }
-
-      @Override public String getName() {
-        return super.getName() + "For" + keyOption + valueOption;
-      }
-
-      MapMaker newBuilder() {
-        MapMaker maker = new MapMaker();
-        keyOption.applyTo(maker);
-        valueOption.applyTo(maker);
-        return maker;
-      }
-
-      <K, V> ConcurrentMap<K, V> newMap() {
-        MapMaker maker = new MapMaker();
-        keyOption.applyTo(maker);
-        valueOption.applyTo(maker);
-        return maker.makeMap();
-      }
-
-      public void testContainsKey() {
-        ConcurrentMap<Object, String> map = newMap();
-        Object k = "key";
-        map.put(k, "value");
-        assertTrue(map.containsKey(k));
-      }
-
-      public void testClear() {
-        ConcurrentMap<String, String> map = newMap();
-        String k = "key";
-        map.put(k, "value");
-        assertFalse(map.isEmpty());
-        map.clear();
-        assertTrue(map.isEmpty());
-        assertNull(map.get(k));
-      }
-
-      public void testKeySet() {
-        ConcurrentMap<String, String> map = newMap();
-        map.put("a", "foo");
-        map.put("b", "foo");
-        Set<String> expected = set("a", "b");
-        assertEquals(expected, map.keySet());
-      }
-
-      public void testValues() {
-        ConcurrentMap<String, String> map = newMap();
-        map.put("a", "1");
-        map.put("b", "2");
-        Set<String> expected = set("1", "2");
-        Set<String> actual = new HashSet<String>();
-        actual.addAll(map.values());
-        assertEquals(expected, actual);
-      }
-
-      public void testPutIfAbsent() {
-        ConcurrentMap<String, String> map = newMap();
-        map.putIfAbsent("a", "1");
-        assertEquals("1", map.get("a"));
-        map.putIfAbsent("a", "2");
-        assertEquals("1", map.get("a"));
-      }
-
-      public void testReplace() {
-        ConcurrentMap<String, String> map = newMap();
-        map.put("a", "1");
-        map.replace("a", "2", "2");
-        assertEquals("1", map.get("a"));
-        map.replace("a", "1", "2");
-        assertEquals("2", map.get("a"));
-      }
-
-      public void testContainsValue() {
-        ConcurrentMap<String, Object> map = newMap();
-        Object v = "value";
-        map.put("key", v);
-        assertTrue(map.containsValue(v));
-      }
-
-      public void testEntrySet() {
-        final ConcurrentMap<String, String> map = newMap();
-        map.put("a", "1");
-        map.put("b", "2");
-        @SuppressWarnings("unchecked")
-        Set<Map.Entry<String, String>> expected
-            = set(Maps.immutableEntry("a", "1"), Maps.immutableEntry("b", "2"));
-        assertEquals(expected, map.entrySet());
-      }
-
-      public void testPutAll() {
-        ConcurrentMap<Object, Object> map = newMap();
-        Object k = "key";
-        Object v = "value";
-        map.putAll(Collections.singletonMap(k, v));
-        assertSame(v, map.get(k));
-      }
-
-      public void testRemove() {
-        ConcurrentMap<Object, String> map = newMap();
-        Object k = "key";
-        map.put(k, "value");
-        map.remove(k);
-        assertFalse(map.containsKey(k));
-      }
-
-      public void testPutGet() {
-        final Object k = new Object();
-        final Object v = new Object();
-        ConcurrentMap<Object, Object> map = newMap();
-        map.put(k, v);
-        assertEquals(1, map.size());
-        assertSame(v, map.get(k));
-        assertEquals(1, map.size());
-        assertNull(map.get(new Object()));
-      }
-
-      public void testCompute() {
-        final Object k = new Object();
-        final Object v = new Object();
-        ConcurrentMap<?, ?> map = newBuilder().makeComputingMap(
-            new Function<Object, Object>() {
-          public Object apply(Object key) {
-            return key == k ? v : null;
-          }
-        });
-
-        assertEquals(0, map.size());
-        assertSame(v, map.get(k));
-        assertSame(v, map.get(k));
-        assertEquals(1, map.size());
-
-        try {
-          map.get(new Object());
-          fail();
-        } catch (NullPointerException e) { /* expected */ }
-        assertEquals(1, map.size());
-      }
-
-      static class MockFunction implements Function<Object, Object>,
-          Serializable {
-        int count;
-        public Object apply(Object key) {
-          count++;
-          return Value.valueOf(key.toString());
-        }
-        private static final long serialVersionUID = 0;
-      }
-    }
-
-    /**
-     * Enums conveniently maintain instance identity across serialization.
-     */
-    enum Key {
-      FOO, BAR, TEE
-    }
-
-    enum Value {
-      FOO, BAR, TEE
-    }
-  }
-
-  public static class ExpiringReferenceMapTest extends TestCase {
-
-    private static final long EXPIRING_TIME = 10;
-    private static final int VALUE_PREFIX = 12345;
-    private static final String KEY_PREFIX = "key prefix:";
-
-    Timer oldTimer;
-    final List<TimerTask> tasks = new ArrayList<TimerTask>();
-
-    @Override
-    protected void setUp() throws Exception {
-      oldTimer = ExpirationTimer.instance;
-      ExpirationTimer.instance = new Timer() {
-        @Override
-        public void schedule(TimerTask task, long delay) {
-          tasks.add(task);
-        }
-      };
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-      ExpirationTimer.instance = oldTimer;
-    }
-
-    private void runTasks() {
-      for (TimerTask task : tasks) {
-        task.run();
-      }
-      tasks.clear();
-    }
-
-    public void testExpiringPut() {
-      ConcurrentMap<String, Integer> map = new MapMaker()
-          .expiration(EXPIRING_TIME, TimeUnit.MILLISECONDS).makeMap();
-
-      for (int i = 0; i < 10; i++) {
-        map.put(KEY_PREFIX + i, VALUE_PREFIX + i);
-        assertEquals(Integer.valueOf(VALUE_PREFIX + i),
-            map.get(KEY_PREFIX + i));
-      }
-
-      runTasks();
-
-      assertEquals("Map must be empty by now", 0, map.size());
-    }
-
-    public void testExpiringPutIfAbsent() {
-      ConcurrentMap<String, Integer> map = new MapMaker()
-          .expiration(EXPIRING_TIME, TimeUnit.MILLISECONDS).makeMap();
-
-      for (int i = 0; i < 10; i++) {
-        map.putIfAbsent(KEY_PREFIX + i, VALUE_PREFIX + i);
-        assertEquals(Integer.valueOf(VALUE_PREFIX + i),
-            map.get(KEY_PREFIX + i));
-      }
-
-      runTasks();
-
-      assertEquals("Map must be empty by now", 0, map.size());
-    }
-
-    public void testExpiringGetForSoft() {
-      ConcurrentMap<String, Integer> map = new MapMaker()
-          .softValues().expiration(EXPIRING_TIME, TimeUnit.MILLISECONDS)
-          .makeMap();
-
-      runExpirationTest(map);
-    }
-
-    public void testExpiringGetForStrong() {
-      ConcurrentMap<String, Integer> map = new MapMaker()
-          .expiration(EXPIRING_TIME, TimeUnit.MILLISECONDS).makeMap();
-
-      runExpirationTest(map);
-    }
-
-    public void testRemovalSchedulerForStrong() {
-      ConcurrentMap<String, Integer> map = new MapMaker()
-          .expiration(EXPIRING_TIME, TimeUnit.MILLISECONDS).makeMap();
-
-      runRemovalScheduler(map, KEY_PREFIX, EXPIRING_TIME);
-    }
-
-    public void testRemovalSchedulerForSoft() {
-      ConcurrentMap<String, Integer> map = new MapMaker()
-          .softValues().expiration(EXPIRING_TIME, TimeUnit.MILLISECONDS)
-          .makeMap();
-
-      runRemovalScheduler(map, KEY_PREFIX, EXPIRING_TIME);
-    }
-
-    private void runExpirationTest(ConcurrentMap<String, Integer> map) {
-      for (int i = 0; i < 10; i++) {
-        map.put(KEY_PREFIX + i, VALUE_PREFIX + i);
-        assertEquals(Integer.valueOf(VALUE_PREFIX + i),
-            map.get(KEY_PREFIX + i));
-      }
-
-      for (int i = 0; i < 10; i++) {
-        assertEquals(Integer.valueOf(i + VALUE_PREFIX),
-            map.get(KEY_PREFIX + i));
-      }
-
-      runTasks();
-
-      for (int i = 0; i < 10; i++) {
-        assertEquals(null, map.get(KEY_PREFIX + i));
-      }
-    }
-
-    private void runRemovalScheduler(ConcurrentMap<String, Integer> map,
-        String keyPrefix, long ttl) {
-
-      int shift1 = 10 + VALUE_PREFIX;
-      // fill with initial data
-      for (int i = 0; i < 10; i++) {
-        map.put(keyPrefix + i, i + shift1);
-        assertEquals(Integer.valueOf(i + shift1), map.get(keyPrefix + i));
-      }
-
-      // wait, so that entries have just 10 ms to live
-      try {
-        Thread.sleep(ttl * 2 / 3);
-      } catch (InterruptedException e) {
-        throw new RuntimeException(e);
-      }
-
-      int shift2 = shift1 + 10;
-      // fill with new data - has to live for 20 ms more
-      for (int i = 0; i < 10; i++) {
-        map.put(keyPrefix + i, i + shift2);
-        assertEquals("key: " + keyPrefix + i,
-            Integer.valueOf(i + shift2), map.get(keyPrefix + i));
-      }
-
-      // old timeouts must expire after this wait
-      try {
-        Thread.sleep(ttl * 2 / 3);
-      } catch (InterruptedException e) {
-        throw new RuntimeException(e);
-      }
-
-      // check that new values are still there - they still have 10 ms to live
-      for (int i = 0; i < 10; i++) {
-        assertEquals(Integer.valueOf(i + shift2), map.get(keyPrefix + i));
-      }
-    }
-  }
-
-  public static class ExpiringComputingReferenceMapTest extends TestCase {
-
-    static final long VERY_LONG = 100000L;
-    static final String KEY_PREFIX = "THIS IS AN ARBITRARY KEY PREFIX";
-    static final int VALUE_SUFFIX = 77777;
-
-    Timer oldTimer;
-    final List<TimerTask> tasks = new ArrayList<TimerTask>();
-
-    @Override
-    protected void setUp() throws Exception {
-      oldTimer = ExpirationTimer.instance;
-      ExpirationTimer.instance = new Timer() {
-        @Override
-        public void schedule(TimerTask task, long delay) {
-          tasks.add(task);
-        }
-      };
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-      ExpirationTimer.instance = oldTimer;
-    }
-
-    private void runTasks() {
-      for (TimerTask task : tasks) {
-        task.run();
-      }
-      tasks.clear();
-    }
-
-    public void testExpiringPut() {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .expiration(50, TimeUnit.MILLISECONDS)
-          .makeComputingMap(WATCHED_CREATOR);
-
-      for (int i = 0; i < 10; i++) {
-        cache.put(KEY_PREFIX + i, i + VALUE_SUFFIX);
-        assertEquals(Integer.valueOf(i + VALUE_SUFFIX),
-            cache.get(KEY_PREFIX + i));
-      }
-
-      for (int i = 0; i < 10; i++) {
-        WATCHED_CREATOR.reset();
-        assertEquals(Integer.valueOf(i + VALUE_SUFFIX),
-            cache.get(KEY_PREFIX + i));
-        assertFalse("Creator should not have been called @#" + i,
-            WATCHED_CREATOR.wasCalled());
-      }
-
-      runTasks();
-
-      assertEquals("Cache must be empty by now", 0, cache.size());
-    }
-
-    public void testExpiringPutIfAbsent() {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .expiration(50, TimeUnit.MILLISECONDS)
-          .makeComputingMap(WATCHED_CREATOR);
-
-      for (int i = 0; i < 10; i++) {
-        cache.putIfAbsent(KEY_PREFIX + i, i + VALUE_SUFFIX);
-        assertEquals(Integer.valueOf(i + VALUE_SUFFIX),
-            cache.get(KEY_PREFIX + i));
-      }
-
-      runTasks();
-
-      assertEquals("Cache must be empty by now", 0, cache.size());
-    }
-
-    public void testExpiringGetForSoft() {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .expiration(5, TimeUnit.MILLISECONDS)
-          .softValues().makeComputingMap(WATCHED_CREATOR);
-
-      runExpirationTest(cache);
-    }
-
-    public void testExpiringGetForStrong() {
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .expiration(10, TimeUnit.MILLISECONDS)
-          .makeComputingMap(WATCHED_CREATOR);
-
-      runExpirationTest(cache);
-    }
-
-    private void runExpirationTest(ConcurrentMap<String, Integer> cache) {
-      for (int i = 0; i < 10; i++) {
-        assertEquals(Integer.valueOf(i + VALUE_SUFFIX),
-            cache.get(KEY_PREFIX + i));
-      }
-
-      for (int i = 0; i < 10; i++) {
-        WATCHED_CREATOR.reset();
-        assertEquals(Integer.valueOf(i + VALUE_SUFFIX),
-            cache.get(KEY_PREFIX + i));
-        assertFalse("Creator should NOT have been called @#" + i,
-            WATCHED_CREATOR.wasCalled());
-      }
-
-      runTasks();
-
-      for (int i = 0; i < 10; i++) {
-        WATCHED_CREATOR.reset();
-        assertEquals(Integer.valueOf(i + VALUE_SUFFIX),
-            cache.get(KEY_PREFIX + i));
-        assertTrue("Creator should have been called @#" + i,
-            WATCHED_CREATOR.wasCalled());
-      }
-    }
-
-    public void testRemovalSchedulerForStrong() {
-      String keyPrefix = "TRSTRONG_";
-      int ttl = 300;
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .expiration(ttl, TimeUnit.MILLISECONDS)
-          .makeComputingMap(new WatchedCreatorFunction(keyPrefix));
-      runRemovalScheduler(cache, keyPrefix, ttl);
-    }
-
-    public void testRemovalSchedulerForSoft() {
-      String keyPrefix = "TRSOFT_";
-      int ttl = 300;
-      ConcurrentMap<String, Integer> cache = new MapMaker()
-          .expiration(ttl, TimeUnit.MILLISECONDS).softValues()
-          .makeComputingMap(new WatchedCreatorFunction(keyPrefix));
-      runRemovalScheduler(cache, keyPrefix, ttl);
-    }
-
-    private void runRemovalScheduler(ConcurrentMap<String, Integer> cache,
-        String keyPrefix, int ttl) {
-      int shift1 = 10 + VALUE_SUFFIX;
-      // fill with initial data
-      for (int i = 0; i < 10; i++) {
-        cache.put(keyPrefix + i, i + shift1);
-        assertEquals(Integer.valueOf(i + shift1), cache.get(keyPrefix + i));
-      }
-
-      // wait, so that entries have just 10 ms to live
-      try {
-        Thread.sleep(ttl * 2 / 3);
-      } catch (InterruptedException e) {
-        throw new RuntimeException(e);
-      }
-
-      int shift2 = shift1 + 10;
-      // fill with new data - has to live for 20 ms more
-      for (int i = 0; i < 10; i++) {
-        cache.put(keyPrefix + i, i + shift2);
-        assertEquals("key: " + keyPrefix + i,
-            Integer.valueOf(i + shift2), cache.get(keyPrefix + i));
-      }
-
-      // old timeouts must expire after this wait
-      try {
-        Thread.sleep(ttl * 2 / 3);
-      } catch (InterruptedException e) {
-        throw new RuntimeException(e);
-      }
-
-      // check that new values are still there - they still have 10 ms to live
-      for (int i = 0; i < 10; i++) {
-        assertEquals(Integer.valueOf(i + shift2), cache.get(keyPrefix + i));
-      }
-    }
-
-    private static class WatchedCreatorFunction
-        implements Function<String, Integer> {
-      boolean wasCalled = false; // must be set in apply()
-
-      public WatchedCreatorFunction() {
-        this(KEY_PREFIX);
-      }
-
-      public WatchedCreatorFunction(String prefix) {
-        setPrefix(prefix);
-      }
-
-      public void reset() {
-        wasCalled = false;
-      }
-
-      protected String prefix = KEY_PREFIX;
-
-      public void setPrefix(String prefix) {
-        this.prefix = prefix;
-      }
-
-      public boolean wasCalled() {
-        return wasCalled;
-      }
-
-      public Integer apply(String s) {
-        wasCalled = true;
-        return Integer.parseInt(s.substring(prefix.length())) + VALUE_SUFFIX;
-      }
-    }
-
-    static final WatchedCreatorFunction WATCHED_CREATOR =
-        new WatchedCreatorFunction();
-  }
-
-  static <E> Set<E> set(E... elements) {
-    return new HashSet<E>(Arrays.asList(elements));
-  }
-}
diff --git a/core/test/com/google/inject/name/NamesTest.java b/core/test/com/google/inject/name/NamesTest.java
index 6812b7b..9ea7ef4 100644
--- a/core/test/com/google/inject/name/NamesTest.java
+++ b/core/test/com/google/inject/name/NamesTest.java
@@ -23,7 +23,7 @@
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableMap;
+import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
 import java.util.Map;
 import java.util.Properties;
diff --git a/core/test/com/google/inject/spi/ElementsTest.java b/core/test/com/google/inject/spi/ElementsTest.java
index 0854447..d0aa890 100644
--- a/core/test/com/google/inject/spi/ElementsTest.java
+++ b/core/test/com/google/inject/spi/ElementsTest.java
@@ -35,9 +35,9 @@
 import com.google.inject.binder.AnnotatedConstantBindingBuilder;
 import com.google.inject.binder.ConstantBindingBuilder;
 import com.google.inject.binder.ScopedBindingBuilder;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
-import static com.google.inject.internal.util.Iterables.getOnlyElement;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import static com.google.common.collect.Iterables.getOnlyElement;
 
 import com.google.inject.matcher.Matcher;
 import com.google.inject.matcher.Matchers;
diff --git a/core/test/com/google/inject/spi/HasDependenciesTest.java b/core/test/com/google/inject/spi/HasDependenciesTest.java
index b164a85..c6310e9 100644
--- a/core/test/com/google/inject/spi/HasDependenciesTest.java
+++ b/core/test/com/google/inject/spi/HasDependenciesTest.java
@@ -22,8 +22,8 @@
 import com.google.inject.Injector;
 import com.google.inject.Key;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
 import java.util.Set;
 import junit.framework.TestCase;
 
diff --git a/core/test/com/google/inject/spi/InjectionPointTest.java b/core/test/com/google/inject/spi/InjectionPointTest.java
index 2e5262f..9c9adec 100644
--- a/core/test/com/google/inject/spi/InjectionPointTest.java
+++ b/core/test/com/google/inject/spi/InjectionPointTest.java
@@ -24,9 +24,9 @@
 import com.google.inject.Key;
 import com.google.inject.TypeLiteral;
 import com.google.inject.internal.ErrorsException;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import static com.google.inject.internal.util.Iterables.getOnlyElement;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import static com.google.common.collect.Iterables.getOnlyElement;
 
 import com.google.inject.name.Named;
 import static com.google.inject.name.Names.named;
diff --git a/core/test/com/google/inject/spi/ModuleRewriterTest.java b/core/test/com/google/inject/spi/ModuleRewriterTest.java
index 0baff33..885585e 100644
--- a/core/test/com/google/inject/spi/ModuleRewriterTest.java
+++ b/core/test/com/google/inject/spi/ModuleRewriterTest.java
@@ -25,7 +25,7 @@
 import com.google.inject.Key;
 import com.google.inject.Module;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import com.google.inject.name.Names;
 import java.util.List;
 import junit.framework.TestCase;
diff --git a/core/test/com/google/inject/spi/ProviderMethodsTest.java b/core/test/com/google/inject/spi/ProviderMethodsTest.java
index 8d2bad4..3a78db9 100644
--- a/core/test/com/google/inject/spi/ProviderMethodsTest.java
+++ b/core/test/com/google/inject/spi/ProviderMethodsTest.java
@@ -29,8 +29,8 @@
 import com.google.inject.Provider;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.internal.ProviderMethod;
 import com.google.inject.internal.ProviderMethodsModule;
 import com.google.inject.name.Named;
diff --git a/core/test/com/google/inject/spi/SpiBindingsTest.java b/core/test/com/google/inject/spi/SpiBindingsTest.java
index a95d4a8..c5b9986 100644
--- a/core/test/com/google/inject/spi/SpiBindingsTest.java
+++ b/core/test/com/google/inject/spi/SpiBindingsTest.java
@@ -29,8 +29,8 @@
 import com.google.inject.Scopes;
 import com.google.inject.Singleton;
 import com.google.inject.Stage;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import com.google.inject.name.Names;
 import java.lang.reflect.Constructor;
 import java.util.Collections;
diff --git a/core/test/com/googlecode/guice/StrictContainerTestSuite.java b/core/test/com/googlecode/guice/StrictContainerTestSuite.java
deleted file mode 100644
index 647bbd7..0000000
--- a/core/test/com/googlecode/guice/StrictContainerTestSuite.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.googlecode.guice;
-
-import com.google.inject.SuiteUtils;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.MapMakerTestSuite;
-import com.google.inject.internal.util.MapMakerTestSuite.ReferenceMapTest;
-import com.google.inject.internal.util.MapMakerTestSuite.ComputingTest;
-import java.io.FilePermission;
-import java.security.AccessControlException;
-import java.security.Permission;
-import java.util.Arrays;
-import java.util.PropertyPermission;
-import java.util.Set;
-import junit.framework.Test;
-
-/**
- * Runs a subset of our tests in a more secure environment. It loads the tests in another
- * classloader, and runs them with a specific security manager. Note that no security manager is in
- * place when test instances are constructed.
- *
- * @author jessewilson@google.com (Jesse Wilson)
- */
-public class StrictContainerTestSuite {
-
-  /** Tests tests require background threads to pass, which the strict container forbids */
-  private static final Set<String> SUPPRESSED_TEST_NAMES = ImmutableSet.of(
-      "testValueCleanupWithWeakKey(" + ReferenceMapTest.class.getName() + ")",
-      "testValueCleanupWithSoftKey(" + ReferenceMapTest.class.getName() + ")",
-      "testKeyCleanupWithWeakKey(" + ReferenceMapTest.class.getName() + ")",
-      "testKeyCleanupWithSoftKey(" + ReferenceMapTest.class.getName() + ")",
-      "testKeyCleanupWithWeakValue(" + ReferenceMapTest.class.getName() + ")",
-      "testKeyCleanupWithSoftValue(" + ReferenceMapTest.class.getName() + ")",
-      "testInternedValueCleanupWithWeakKey(" + ReferenceMapTest.class.getName() + ")",
-      "testInternedValueCleanupWithSoftKey(" + ReferenceMapTest.class.getName() + ")",
-      "testInternedKeyCleanupWithWeakValue(" + ReferenceMapTest.class.getName() + ")",
-      "testInternedKeyCleanupWithSoftValue(" + ReferenceMapTest.class.getName() + ")",
-      "testSleepConcurrency(" + ComputingTest.class.getName() + ")",
-      "testBusyConcurrency(" + ComputingTest.class.getName() + ")",
-      "testFastConcurrency(" + ComputingTest.class.getName() + ")",
-      "testSleepCanonical(" + ComputingTest.class.getName() + ")",
-      "testBusyCanonical(" + ComputingTest.class.getName() + ")",
-      "testFastCanonical(" + ComputingTest.class.getName() + ")"
-  );
-
-  public static Test suite() {
-    SecurityManager securityManager = new SecurityManager() {
-      @Override public void checkPermission(Permission permission) {
-        if (permission instanceof FilePermission
-            || permission instanceof PropertyPermission) {
-          return; // avoid creating a stacktrace for common permissions
-        }
-
-        String stacktrace = Arrays.toString(new Throwable().getStackTrace());
-        if (stacktrace.contains("Thread.<init>")
-            || stacktrace.contains(".getSystemClassLoader(")) {
-          throw new AccessControlException("StrictContainerTestSuite forbids this!");
-        }
-      }
-
-      @Override public void checkPermission(Permission permission, Object context) {
-        checkPermission(permission);
-      }
-    };
-
-    StrictContainerTestSuiteBuilder builder = new StrictContainerTestSuiteBuilder(securityManager);
-    /*if[AOP]*/
-    builder.add(BytecodeGenTest.class.getName());
-    /*end[AOP]*/
-    builder.addSuite(MapMakerTestSuite.class.getName());
-
-    return SuiteUtils.removeSuppressedTests(builder.build(), SUPPRESSED_TEST_NAMES);
-  }
-}
diff --git a/core/test/com/googlecode/guice/StrictContainerTestSuiteBuilder.java b/core/test/com/googlecode/guice/StrictContainerTestSuiteBuilder.java
deleted file mode 100644
index 82838b8..0000000
--- a/core/test/com/googlecode/guice/StrictContainerTestSuiteBuilder.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.googlecode.guice;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Collections;
-import java.util.Enumeration;
-import junit.extensions.TestDecorator;
-import junit.framework.Test;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-/**
- * Builds a test suite whose tests are loaded in a private classloader and run them with a security
- * manager.
- *
- * @author jessewilson@google.com (Jesse Wilson)
- */
-public class StrictContainerTestSuiteBuilder {
-
-  private final ClassLoader classLoader = new NonSystemClassLoader();
-  private final SecurityManager securityManager;
-  private final TestSuite testSuite = new TestSuite("StrictContainer");
-
-  public StrictContainerTestSuiteBuilder(SecurityManager securityManager) {
-    this.securityManager = securityManager;
-  }
-
-  public void add(String testClassName) {
-    try {
-      Class<?> testClass = classLoader.loadClass(testClassName);
-      testSuite.addTest(securityManaged(new TestSuite(testClass)));
-    } catch (Exception e) {
-      testSuite.addTest(new SuiteConstructionError(testClassName, e));
-    }
-  }
-
-  public void addSuite(String suiteClassname) {
-    try {
-      Class<?> suiteClass = classLoader.loadClass(suiteClassname);
-      Test testSuite = (Test) suiteClass.getMethod("suite").invoke(null);
-      this.testSuite.addTest(securityManaged(testSuite));
-    } catch (Exception e) {
-      testSuite.addTest(new SuiteConstructionError(suiteClassname, e));
-    }
-  }
-
-  public TestSuite build() {
-    return testSuite;
-  }
-
-  /**
-   * A classloader that reloads everything outside of the JDK.
-   */
-  static class NonSystemClassLoader extends URLClassLoader {
-    public NonSystemClassLoader() {
-      super(new URL[0]);
-
-      for (final String element : System.getProperty("java.class.path").split(File.pathSeparator)) {
-        try {
-          // is it a remote/local URL?
-          addURL(new URL(element));
-        } catch (MalformedURLException e1) {
-          // nope - perhaps it's a filename?
-          try {
-            addURL(new File(element).toURI().toURL());
-          } catch (MalformedURLException e2) {
-            throw new RuntimeException(e1);
-          }
-        }
-      }
-    }
-
-    @Override
-    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-      // check our local cache to avoid duplicates
-      synchronized (this) {
-        Class<?> clazz = findLoadedClass(name);
-        if (clazz != null) {
-          return clazz;
-        }
-      }
-
-      if (name.startsWith("java.")
-          || name.startsWith("javax.")
-          || name.startsWith("junit.")
-          || name.startsWith("sun.")
-          || name.startsWith("com.sun.")
-          || name.contains("cglib")) {
-        return super.loadClass(name, resolve);
-      }
-
-      Class<?> clazz = findClass(name);
-      if (resolve) {
-        resolveClass(clazz);
-      }
-      return clazz;
-    }
-  }
-
-  /**
-   * Returns a test that sets up and tears down a security manager while it's run.
-   */
-  public Test securityManaged(Test test) {
-    if (test instanceof TestSuite) {
-      TestSuite suite = (TestSuite) test;
-      TestSuite result = new TestSuite(suite.getName());
-
-      @SuppressWarnings("unchecked") // a test suite's elements are tests
-      Enumeration<Test> children = (Enumeration<Test>) suite.tests();
-      for (Test child : Collections.list(children)) {
-        result.addTest(securityManaged(child));
-      }
-      return result;
-
-    } else {
-      return new TestDecorator(test) {
-        public void run(TestResult testResult) {
-          SecurityManager originalSecurityManager = System.getSecurityManager();
-          System.setSecurityManager(securityManager);
-          try {
-            basicRun(testResult);
-          } finally {
-            testResult.endTest(this);
-            System.setSecurityManager(originalSecurityManager);
-          }
-        }
-      };
-    }
-  }
-
-  /**
-   * A simple test that always fails with an exception.
-   */
-  private static class SuiteConstructionError implements Test {
-    private String className;
-    private final Exception cause;
-
-    public SuiteConstructionError(String className, Exception cause) {
-      this.className = className;
-      this.cause = cause;
-    }
-
-    public void run(TestResult testResult) {
-      testResult.addError(this, cause);
-    }
-
-    public int countTestCases() {
-      return 1;
-    }
-
-    @Override public String toString() {
-      return className;
-    }
-  }
-}
diff --git a/extensions/assistedinject/build.xml b/extensions/assistedinject/build.xml
index 28afc25..16557de 100644
--- a/extensions/assistedinject/build.xml
+++ b/extensions/assistedinject/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java b/extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java
index 78b79af..d3d94aa 100755
--- a/extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java
+++ b/extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.Inject;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
diff --git a/extensions/assistedinject/src/com/google/inject/assistedinject/BindingCollector.java b/extensions/assistedinject/src/com/google/inject/assistedinject/BindingCollector.java
index 3f8dedb..d464b6a 100644
--- a/extensions/assistedinject/src/com/google/inject/assistedinject/BindingCollector.java
+++ b/extensions/assistedinject/src/com/google/inject/assistedinject/BindingCollector.java
@@ -18,8 +18,8 @@
 import com.google.inject.ConfigurationException;
 import com.google.inject.Key;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
 import com.google.inject.spi.Message;
 import java.util.Collections;
 import java.util.Map;
diff --git a/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider.java b/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider.java
index 1d9e3f3..b2c6103 100755
--- a/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider.java
+++ b/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider.java
@@ -26,10 +26,10 @@
 import com.google.inject.internal.BytecodeGen;
 import com.google.inject.internal.Errors;
 import com.google.inject.internal.ErrorsException;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
 import com.google.inject.spi.Message;
diff --git a/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java b/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
index 135c63b..430738f 100644
--- a/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
+++ b/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
@@ -16,8 +16,8 @@
 
 package com.google.inject.assistedinject;
 
-import static com.google.inject.internal.util.Iterables.getOnlyElement;
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.collect.Iterables.getOnlyElement;
+import static com.google.common.base.Preconditions.checkState;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Binder;
@@ -36,12 +36,12 @@
 import com.google.inject.internal.Errors;
 import com.google.inject.internal.ErrorsException;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Iterables;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.ToStringBuilder;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
@@ -141,7 +141,7 @@
 
     @Override
     public String toString() {
-      return new ToStringBuilder(getClass())
+      return Objects.toStringHelper(getClass())
         .add("ctor", constructor)
         .add("return type", returnType)
         .add("param type", paramTypes)
diff --git a/extensions/assistedinject/src/com/google/inject/assistedinject/Parameter.java b/extensions/assistedinject/src/com/google/inject/assistedinject/Parameter.java
index dfb830d..ab5bad7 100755
--- a/extensions/assistedinject/src/com/google/inject/assistedinject/Parameter.java
+++ b/extensions/assistedinject/src/com/google/inject/assistedinject/Parameter.java
@@ -21,7 +21,7 @@
 import com.google.inject.Key;
 import com.google.inject.Provider;
 import com.google.inject.internal.Annotations;
-import static com.google.inject.internal.util.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkArgument;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
diff --git a/extensions/assistedinject/test/com/google/inject/assistedinject/ExtensionSpiTest.java b/extensions/assistedinject/test/com/google/inject/assistedinject/ExtensionSpiTest.java
index 620741f..16cd6e4 100644
--- a/extensions/assistedinject/test/com/google/inject/assistedinject/ExtensionSpiTest.java
+++ b/extensions/assistedinject/test/com/google/inject/assistedinject/ExtensionSpiTest.java
@@ -25,10 +25,10 @@
 import com.google.inject.Injector;

 import com.google.inject.Key;

 import com.google.inject.Stage;

-import com.google.inject.internal.util.ImmutableList;

-import com.google.inject.internal.util.ImmutableSet;

-import com.google.inject.internal.util.Iterables;

-import com.google.inject.internal.util.Lists;

+import com.google.common.collect.ImmutableList;

+import com.google.common.collect.ImmutableSet;

+import com.google.common.collect.Iterables;

+import com.google.common.collect.Lists;

 import com.google.inject.name.Named;

 import com.google.inject.spi.DefaultBindingTargetVisitor;

 import com.google.inject.spi.Dependency;

diff --git a/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryModuleBuilderTest.java b/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryModuleBuilderTest.java
index 3af5671..52dfc0b 100644
--- a/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryModuleBuilderTest.java
+++ b/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryModuleBuilderTest.java
@@ -39,8 +39,8 @@
 import com.google.inject.Singleton;
 import com.google.inject.Stage;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import com.google.inject.spi.Dependency;
diff --git a/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryProviderTest.java b/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryProviderTest.java
index e3abf7c..1ab1757 100755
--- a/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryProviderTest.java
+++ b/extensions/assistedinject/test/com/google/inject/assistedinject/FactoryProviderTest.java
@@ -27,7 +27,7 @@
 import com.google.inject.Key;
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import com.google.inject.spi.Dependency;
diff --git a/extensions/grapher/build.xml b/extensions/grapher/build.xml
index 1715af3..d36fdcd 100644
--- a/extensions/grapher/build.xml
+++ b/extensions/grapher/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/grapher/src/com/google/inject/grapher/DependencyEdge.java b/extensions/grapher/src/com/google/inject/grapher/DependencyEdge.java
index b76a90c..5b454a7 100644
--- a/extensions/grapher/src/com/google/inject/grapher/DependencyEdge.java
+++ b/extensions/grapher/src/com/google/inject/grapher/DependencyEdge.java
@@ -16,7 +16,6 @@
 
 package com.google.inject.grapher;
 
-import com.google.inject.internal.util.Nullable;
 import com.google.inject.spi.InjectionPoint;
 
 /**
@@ -45,6 +44,6 @@
      *     {@literal @}{@link Inject}ed. 
      * @param toId The ID for the interface node that satisfies the dependency.
      */
-    T newDependencyEdge(K fromId, @Nullable InjectionPoint fromPoint, K toId);
+    T newDependencyEdge(K fromId, InjectionPoint fromPoint, K toId);
   }
 }
diff --git a/extensions/grapher/src/com/google/inject/grapher/GraphingVisitor.java b/extensions/grapher/src/com/google/inject/grapher/GraphingVisitor.java
index b8c9b62..b5d2341 100644
--- a/extensions/grapher/src/com/google/inject/grapher/GraphingVisitor.java
+++ b/extensions/grapher/src/com/google/inject/grapher/GraphingVisitor.java
@@ -20,8 +20,7 @@
 import com.google.inject.Inject;
 import com.google.inject.Key;
 import com.google.inject.Provider;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Nullable;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.ConstructorBinding;
 import com.google.inject.spi.ConvertedConstantBinding;
@@ -216,7 +215,7 @@
    * @return The newly-created and added {@link DependencyEdge}.
    */
   protected D newDependencyEdge(K nodeId,
-      @Nullable InjectionPoint injectionPoint, Dependency<?> dependency) {
+      InjectionPoint injectionPoint, Dependency<?> dependency) {
     K toId = idFactory.getClassNodeId(dependency.getKey());
     return dependencyEdgeFactory.newDependencyEdge(nodeId, injectionPoint, toId);
   }
diff --git a/extensions/grapher/src/com/google/inject/grapher/InjectorGrapher.java b/extensions/grapher/src/com/google/inject/grapher/InjectorGrapher.java
index d0b602f..9e9a1e2 100644
--- a/extensions/grapher/src/com/google/inject/grapher/InjectorGrapher.java
+++ b/extensions/grapher/src/com/google/inject/grapher/InjectorGrapher.java
@@ -21,7 +21,7 @@
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.BindingTargetVisitor;
 import java.io.IOException;
 import java.util.Collection;
diff --git a/extensions/grapher/src/com/google/inject/grapher/ShortNameFactory.java b/extensions/grapher/src/com/google/inject/grapher/ShortNameFactory.java
index 83c145a..4968458 100644
--- a/extensions/grapher/src/com/google/inject/grapher/ShortNameFactory.java
+++ b/extensions/grapher/src/com/google/inject/grapher/ShortNameFactory.java
@@ -18,8 +18,8 @@
 
 import com.google.inject.Key;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.Join;
-import com.google.inject.internal.util.Lists;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
 import com.google.inject.internal.ProviderMethod;
 import com.google.inject.internal.util.StackTraceElements;
 import java.lang.annotation.Annotation;
@@ -118,7 +118,7 @@
       paramStrings.add(paramType.getSimpleName());
     }
 
-    String paramString = Join.join(", ", paramStrings);
+    String paramString = Joiner.on(", ").join(paramStrings);
     return "#" + method.getName() + "(" + paramString + ")";
   }
 
diff --git a/extensions/grapher/src/com/google/inject/grapher/TransitiveDependencyVisitor.java b/extensions/grapher/src/com/google/inject/grapher/TransitiveDependencyVisitor.java
index 62dcdd2..1a3d900 100644
--- a/extensions/grapher/src/com/google/inject/grapher/TransitiveDependencyVisitor.java
+++ b/extensions/grapher/src/com/google/inject/grapher/TransitiveDependencyVisitor.java
@@ -17,8 +17,8 @@
 package com.google.inject.grapher;
 
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.ConstructorBinding;
 import com.google.inject.spi.ConvertedConstantBinding;
diff --git a/extensions/grapher/src/com/google/inject/grapher/graphviz/BindingEdgeFactory.java b/extensions/grapher/src/com/google/inject/grapher/graphviz/BindingEdgeFactory.java
index 68d61e7..9dd40e4 100644
--- a/extensions/grapher/src/com/google/inject/grapher/graphviz/BindingEdgeFactory.java
+++ b/extensions/grapher/src/com/google/inject/grapher/graphviz/BindingEdgeFactory.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.Inject;
 import com.google.inject.grapher.BindingEdge;
-import com.google.inject.internal.util.ImmutableList;
+import com.google.common.collect.ImmutableList;
 
 /**
  * Graphviz-specific implementation of {@link BindingEdge.Factory}. Uses a
diff --git a/extensions/grapher/src/com/google/inject/grapher/graphviz/DependencyEdgeFactory.java b/extensions/grapher/src/com/google/inject/grapher/graphviz/DependencyEdgeFactory.java
index ca82c92..d703acb 100644
--- a/extensions/grapher/src/com/google/inject/grapher/graphviz/DependencyEdgeFactory.java
+++ b/extensions/grapher/src/com/google/inject/grapher/graphviz/DependencyEdgeFactory.java
@@ -18,7 +18,7 @@
 
 import com.google.inject.Inject;
 import com.google.inject.grapher.DependencyEdge;
-import com.google.inject.internal.util.ImmutableList;
+import com.google.common.collect.ImmutableList;
 import com.google.inject.spi.InjectionPoint;
 
 /**
diff --git a/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizEdge.java b/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizEdge.java
index aab1cb8..2618717 100644
--- a/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizEdge.java
+++ b/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizEdge.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.grapher.graphviz;
 
-import com.google.inject.internal.util.ImmutableList;
+import com.google.common.collect.ImmutableList;
 import java.util.List;
 
 /**
diff --git a/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizNode.java b/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizNode.java
index 9b06ba6..a5a989b 100644
--- a/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizNode.java
+++ b/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizNode.java
@@ -16,9 +16,9 @@
 
 package com.google.inject.grapher.graphviz;
 
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
 import java.util.List;
 import java.util.Map;
 
diff --git a/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizRenderer.java b/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizRenderer.java
index 7d01f5f..891641f 100644
--- a/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizRenderer.java
+++ b/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizRenderer.java
@@ -19,9 +19,9 @@
 import com.google.inject.grapher.ImplementationNode;
 import com.google.inject.grapher.NodeAliasFactory;
 import com.google.inject.grapher.Renderer;
-import com.google.inject.internal.util.Join;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import java.io.PrintWriter;
 import java.util.List;
 import java.util.Map;
@@ -140,7 +140,7 @@
     html.append("<tr>").append("<td align=\"left\" port=\"header\" ");
     html.append("bgcolor=\"" + node.getHeaderBackgroundColor() + "\">");
     
-    String subtitle = Join.join("<br align=\"left\"/>", node.getSubtitles());
+    String subtitle = Joiner.on("<br align=\"left\"/>").join(node.getSubtitles());
     if (subtitle.length() != 0) {
       html.append("<font color=\"").append(node.getHeaderTextColor());
       html.append("\" point-size=\"10\">");
@@ -196,7 +196,7 @@
       }
     }
     
-    return "[" + Join.join(", ", attrList) + "]";
+    return "[" + Joiner.on(", ").join(attrList) + "]";
   }
 
   /**
@@ -205,7 +205,7 @@
    * them.
    */
   protected String getArrowString(List<ArrowType> arrows) {
-    return Join.join("", arrows);
+    return Joiner.on("").join(arrows);
   }
 
   protected String getEdgeEndPoint(String nodeId, String portId, CompassPoint compassPoint) {
@@ -219,7 +219,7 @@
       portStrings.add(compassPoint.toString());
     }
     
-    return Join.join(":", portStrings);
+    return Joiner.on(":").join(portStrings);
   }
 
   protected String htmlEscape(String str) {
diff --git a/extensions/grapher/test/com/google/inject/grapher/GraphingVisitorTest.java b/extensions/grapher/test/com/google/inject/grapher/GraphingVisitorTest.java
index 8b4ce45..84f03c3 100644
--- a/extensions/grapher/test/com/google/inject/grapher/GraphingVisitorTest.java
+++ b/extensions/grapher/test/com/google/inject/grapher/GraphingVisitorTest.java
@@ -21,8 +21,8 @@
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.ConstructorBinding;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
diff --git a/extensions/grapher/test/com/google/inject/grapher/InjectorGrapherTest.java b/extensions/grapher/test/com/google/inject/grapher/InjectorGrapherTest.java
index ab6ee96..45d19ae 100644
--- a/extensions/grapher/test/com/google/inject/grapher/InjectorGrapherTest.java
+++ b/extensions/grapher/test/com/google/inject/grapher/InjectorGrapherTest.java
@@ -8,8 +8,8 @@
 import com.google.inject.Injector;

 import com.google.inject.Key;

 import com.google.inject.Provides;

-import com.google.inject.internal.util.ImmutableSet;

-import com.google.inject.internal.util.Sets;

+import com.google.common.collect.ImmutableSet;

+import com.google.common.collect.Sets;

 import com.google.inject.name.Named;

 import com.google.inject.name.Names;

 import com.google.inject.spi.BindingTargetVisitor;

diff --git a/extensions/grapher/test/com/google/inject/grapher/TransitiveDependencyVisitorTest.java b/extensions/grapher/test/com/google/inject/grapher/TransitiveDependencyVisitorTest.java
index 8e896f7..1d4b414 100644
--- a/extensions/grapher/test/com/google/inject/grapher/TransitiveDependencyVisitorTest.java
+++ b/extensions/grapher/test/com/google/inject/grapher/TransitiveDependencyVisitorTest.java
@@ -24,7 +24,7 @@
 import com.google.inject.Module;
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.name.Names;
 import com.google.inject.spi.ConstructorBinding;
 import com.google.inject.spi.ConvertedConstantBinding;
diff --git a/extensions/jmx/build.xml b/extensions/jmx/build.xml
index e9436ee..1bdcb97 100644
--- a/extensions/jmx/build.xml
+++ b/extensions/jmx/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/jndi/build.xml b/extensions/jndi/build.xml
index 82be3ed..14eaa8b 100644
--- a/extensions/jndi/build.xml
+++ b/extensions/jndi/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/multibindings/build.xml b/extensions/multibindings/build.xml
index b8b3399..7a23462 100644
--- a/extensions/multibindings/build.xml
+++ b/extensions/multibindings/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java b/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java
index 10562af..b2590be 100644
--- a/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java
+++ b/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java
@@ -25,10 +25,10 @@
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
 import com.google.inject.binder.LinkedBindingBuilder;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import com.google.inject.multibindings.Multibinder.RealMultibinder;
 import static com.google.inject.multibindings.Multibinder.checkConfiguration;
 import static com.google.inject.multibindings.Multibinder.checkNotNull;
diff --git a/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java b/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
index 34347a4..3af78a5 100644
--- a/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
+++ b/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
@@ -28,9 +28,9 @@
 import com.google.inject.binder.LinkedBindingBuilder;
 import com.google.inject.internal.Annotations;
 import com.google.inject.internal.Errors;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import static com.google.inject.name.Names.named;
 
 import com.google.inject.spi.BindingTargetVisitor;
diff --git a/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java b/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
index 314b10e..6f4153d 100644
--- a/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
+++ b/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
@@ -38,8 +38,8 @@
 import com.google.inject.ProvisionException;
 import com.google.inject.Stage;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
 import com.google.inject.name.Names;
 import com.google.inject.spi.DefaultElementVisitor;
 import com.google.inject.spi.Element;
diff --git a/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java b/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java
index b4d4046..af6e48f 100644
--- a/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java
+++ b/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java
@@ -51,9 +51,9 @@
 import com.google.inject.ProvisionException;
 import com.google.inject.Stage;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 import com.google.inject.name.Names;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
diff --git a/extensions/multibindings/test/com/google/inject/multibindings/SpiUtils.java b/extensions/multibindings/test/com/google/inject/multibindings/SpiUtils.java
index 2885d73..416ab5e 100644
--- a/extensions/multibindings/test/com/google/inject/multibindings/SpiUtils.java
+++ b/extensions/multibindings/test/com/google/inject/multibindings/SpiUtils.java
@@ -43,7 +43,7 @@
 import com.google.inject.Key;

 import com.google.inject.Module;

 import com.google.inject.TypeLiteral;

-import com.google.inject.internal.util.Lists;

+import com.google.common.collect.Lists;

 import com.google.inject.spi.DefaultBindingTargetVisitor;

 import com.google.inject.spi.Element;

 import com.google.inject.spi.Elements;

diff --git a/extensions/persist/build.xml b/extensions/persist/build.xml
index ad68079..9be40c8 100644
--- a/extensions/persist/build.xml
+++ b/extensions/persist/build.xml
@@ -11,7 +11,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/persist/src/com/google/inject/persist/jpa/JpaFinderProxy.java b/extensions/persist/src/com/google/inject/persist/jpa/JpaFinderProxy.java
index 7aae70c..825916f 100644
--- a/extensions/persist/src/com/google/inject/persist/jpa/JpaFinderProxy.java
+++ b/extensions/persist/src/com/google/inject/persist/jpa/JpaFinderProxy.java
@@ -19,7 +19,7 @@
 import com.google.inject.Inject;

 import com.google.inject.Provider;

 import com.google.inject.Singleton;

-import com.google.inject.internal.util.MapMaker;

+import com.google.common.collect.MapMaker;

 import com.google.inject.name.Named;

 import com.google.inject.persist.finder.Finder;

 import com.google.inject.persist.finder.FirstResult;

diff --git a/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistModule.java b/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistModule.java
index ded3642..2e84fa0 100644
--- a/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistModule.java
+++ b/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistModule.java
@@ -18,8 +18,8 @@
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.base.Preconditions;
 import com.google.inject.persist.PersistModule;
 import com.google.inject.persist.PersistService;
 import com.google.inject.persist.UnitOfWork;
diff --git a/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java b/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java
index 1da61f7..a10dc74 100644
--- a/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java
+++ b/extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java
@@ -19,10 +19,15 @@
 import com.google.inject.Inject;

 import com.google.inject.Provider;

 import com.google.inject.Singleton;

-import com.google.inject.internal.util.Nullable;

-import com.google.inject.internal.util.Preconditions;

+import com.google.common.base.Preconditions;

 import com.google.inject.persist.PersistService;

 import com.google.inject.persist.UnitOfWork;

+

+import java.lang.annotation.Documented;

+import java.lang.annotation.ElementType;

+import java.lang.annotation.Retention;

+import java.lang.annotation.RetentionPolicy;

+import java.lang.annotation.Target;

 import java.util.Properties;

 import javax.persistence.EntityManager;

 import javax.persistence.EntityManagerFactory;

@@ -114,4 +119,10 @@
       return emProvider.emFactory;

     }

   }

+  

+  @Documented

+  @Retention(RetentionPolicy.RUNTIME)

+  @Target(ElementType.PARAMETER)

+  private @interface Nullable { }

+

 }

diff --git a/extensions/service/src/com/google/inject/service/AsyncService.java b/extensions/service/src/com/google/inject/service/AsyncService.java
index 325606a..9b54c1a 100644
--- a/extensions/service/src/com/google/inject/service/AsyncService.java
+++ b/extensions/service/src/com/google/inject/service/AsyncService.java
@@ -16,7 +16,7 @@
 
 package com.google.inject.service;
 
-import com.google.inject.internal.util.Preconditions;
+import com.google.common.base.Preconditions;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
diff --git a/extensions/service/src/com/google/inject/service/CompositeService.java b/extensions/service/src/com/google/inject/service/CompositeService.java
index 2fea9d5..5e6986a 100644
--- a/extensions/service/src/com/google/inject/service/CompositeService.java
+++ b/extensions/service/src/com/google/inject/service/CompositeService.java
@@ -18,10 +18,10 @@
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Preconditions;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Sets;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.Callable;
diff --git a/extensions/servlet/build.xml b/extensions/servlet/build.xml
index 7b1f76f..d7a10e1 100644
--- a/extensions/servlet/build.xml
+++ b/extensions/servlet/build.xml
@@ -12,7 +12,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/servlet/src/com/google/inject/servlet/ContinuingHttpServletRequest.java b/extensions/servlet/src/com/google/inject/servlet/ContinuingHttpServletRequest.java
index a8b86b3..50672e5 100644
--- a/extensions/servlet/src/com/google/inject/servlet/ContinuingHttpServletRequest.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ContinuingHttpServletRequest.java
@@ -17,7 +17,7 @@
 package com.google.inject.servlet;
 
 import com.google.inject.OutOfScopeException;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.Maps;
 import java.io.IOException;
 import java.util.Map;
 import javax.servlet.ServletInputStream;
diff --git a/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java b/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java
index e09d79d..6c9d67b 100755
--- a/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java
+++ b/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java
@@ -18,7 +18,7 @@
 import com.google.inject.Injector;
 import com.google.inject.Key;
 import com.google.inject.Scopes;
-import com.google.inject.internal.util.Iterators;
+import com.google.common.collect.Iterators;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.ProviderInstanceBinding;
 import com.google.inject.spi.ProviderWithExtensionVisitor;
diff --git a/extensions/servlet/src/com/google/inject/servlet/FiltersModuleBuilder.java b/extensions/servlet/src/com/google/inject/servlet/FiltersModuleBuilder.java
index b593a12..14266df 100755
--- a/extensions/servlet/src/com/google/inject/servlet/FiltersModuleBuilder.java
+++ b/extensions/servlet/src/com/google/inject/servlet/FiltersModuleBuilder.java
@@ -17,7 +17,7 @@
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.Lists;
 import com.google.inject.internal.UniqueAnnotations;
 import java.util.HashMap;
 import java.util.List;
diff --git a/extensions/servlet/src/com/google/inject/servlet/InstanceFilterBindingImpl.java b/extensions/servlet/src/com/google/inject/servlet/InstanceFilterBindingImpl.java
index 4ed7b9c..f752801 100644
--- a/extensions/servlet/src/com/google/inject/servlet/InstanceFilterBindingImpl.java
+++ b/extensions/servlet/src/com/google/inject/servlet/InstanceFilterBindingImpl.java
@@ -20,7 +20,7 @@
 

 import javax.servlet.Filter;

 

-import com.google.inject.internal.util.ToStringBuilder;

+import com.google.common.base.Objects;

 

 /**

  * Default implementation of InstanceFilterBinding.

@@ -40,7 +40,7 @@
   }

   

   @Override public String toString() {

-    return new ToStringBuilder(InstanceFilterBinding.class)

+    return Objects.toStringHelper(InstanceFilterBinding.class)

       .add("pattern", getPattern())

       .add("initParams", getInitParams())

       .add("uriPatternType", getUriPatternType())

diff --git a/extensions/servlet/src/com/google/inject/servlet/InstanceServletBindingImpl.java b/extensions/servlet/src/com/google/inject/servlet/InstanceServletBindingImpl.java
index 0658843..0409ef9 100644
--- a/extensions/servlet/src/com/google/inject/servlet/InstanceServletBindingImpl.java
+++ b/extensions/servlet/src/com/google/inject/servlet/InstanceServletBindingImpl.java
@@ -20,7 +20,7 @@
 

 import javax.servlet.http.HttpServlet;

 

-import com.google.inject.internal.util.ToStringBuilder;

+import com.google.common.base.Objects;

 

 /**

  * Default implementation of InstanceServletBinding.

@@ -40,7 +40,7 @@
   }

 

   @Override public String toString() {

-    return new ToStringBuilder(InstanceServletBinding.class)

+    return Objects.toStringHelper(InstanceServletBinding.class)

       .add("pattern", getPattern())

       .add("initParams", getInitParams())

       .add("uriPatternType", getUriPatternType())

diff --git a/extensions/servlet/src/com/google/inject/servlet/LinkedFilterBindingImpl.java b/extensions/servlet/src/com/google/inject/servlet/LinkedFilterBindingImpl.java
index acbfe51..9a4fb28 100644
--- a/extensions/servlet/src/com/google/inject/servlet/LinkedFilterBindingImpl.java
+++ b/extensions/servlet/src/com/google/inject/servlet/LinkedFilterBindingImpl.java
@@ -20,8 +20,8 @@
 

 import javax.servlet.Filter;

 

+import com.google.common.base.Objects;

 import com.google.inject.Key;

-import com.google.inject.internal.util.ToStringBuilder;

 

 /**

  * Default implementation of LinkedFilterBinding.

@@ -41,7 +41,7 @@
   }

   

   @Override public String toString() {

-    return new ToStringBuilder(LinkedFilterBinding.class)

+    return Objects.toStringHelper(LinkedFilterBinding.class)

       .add("pattern", getPattern())

       .add("initParams", getInitParams())

       .add("uriPatternType", getUriPatternType())

diff --git a/extensions/servlet/src/com/google/inject/servlet/LinkedServletBindingImpl.java b/extensions/servlet/src/com/google/inject/servlet/LinkedServletBindingImpl.java
index c72fcd7..7704946 100644
--- a/extensions/servlet/src/com/google/inject/servlet/LinkedServletBindingImpl.java
+++ b/extensions/servlet/src/com/google/inject/servlet/LinkedServletBindingImpl.java
@@ -20,8 +20,8 @@
 

 import javax.servlet.http.HttpServlet;

 

+import com.google.common.base.Objects;

 import com.google.inject.Key;

-import com.google.inject.internal.util.ToStringBuilder;

 

 /**

  * Default implementation of LinkedServletBinding.

@@ -41,7 +41,7 @@
   }

 

   @Override public String toString() {

-    return new ToStringBuilder(LinkedServletBinding.class)

+    return Objects.toStringHelper(LinkedServletBinding.class)

       .add("pattern", getPattern())

       .add("initParams", getInitParams())

       .add("uriPatternType", getUriPatternType())

diff --git a/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java b/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java
index fad7294..9725280 100755
--- a/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java
@@ -21,9 +21,9 @@
 import com.google.inject.Provider;
 import com.google.inject.Singleton;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
 import java.util.Set;
diff --git a/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java b/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java
index 4267815..aef35f5 100755
--- a/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java
@@ -20,10 +20,10 @@
 import com.google.inject.Injector;
 import com.google.inject.Singleton;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Preconditions;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
 import java.util.Set;
diff --git a/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java b/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java
index 56d5d7e..5d981ed 100755
--- a/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java
@@ -18,7 +18,7 @@
 import com.google.inject.Injector;
 import com.google.inject.Key;
 import com.google.inject.Scopes;
-import com.google.inject.internal.util.Iterators;
+import com.google.common.collect.Iterators;
 import com.google.inject.spi.BindingTargetVisitor;
 import com.google.inject.spi.ProviderInstanceBinding;
 import com.google.inject.spi.ProviderWithExtensionVisitor;
diff --git a/extensions/servlet/src/com/google/inject/servlet/ServletModule.java b/extensions/servlet/src/com/google/inject/servlet/ServletModule.java
index 057e0e9..4bd5441 100644
--- a/extensions/servlet/src/com/google/inject/servlet/ServletModule.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ServletModule.java
@@ -16,11 +16,11 @@
 
 package com.google.inject.servlet;
 
-import static com.google.inject.internal.util.Preconditions.checkState;
+import static com.google.common.base.Preconditions.checkState;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
 import java.util.Map;
 import javax.servlet.Filter;
 import javax.servlet.ServletContext;
@@ -238,7 +238,7 @@
    * @since 2.0
    */
   protected final FilterKeyBindingBuilder filter(String urlPattern, String... morePatterns) {
-    return filtersModuleBuilder.filter(Lists.newArrayList(urlPattern, morePatterns));
+    return filtersModuleBuilder.filter(ImmutableList.<String>builder().add(urlPattern).add(morePatterns).build());
   }
 
   /**
@@ -246,7 +246,7 @@
    * @since 2.0
    */
   protected final FilterKeyBindingBuilder filterRegex(String regex, String... regexes) {
-    return filtersModuleBuilder.filterRegex(Lists.newArrayList(regex, regexes));
+    return filtersModuleBuilder.filterRegex(ImmutableList.<String>builder().add(regex).add(regexes).build());
   }
 
   /**
@@ -254,7 +254,7 @@
    * @since 2.0
    */
   protected final ServletKeyBindingBuilder serve(String urlPattern, String... morePatterns) {
-    return servletsModuleBuilder.serve(Lists.newArrayList(urlPattern, morePatterns));
+    return servletsModuleBuilder.serve(ImmutableList.<String>builder().add(urlPattern).add(morePatterns).build());
   }
 
   /**
@@ -262,7 +262,7 @@
    * @since 2.0
    */
   protected final ServletKeyBindingBuilder serveRegex(String regex, String... regexes) {
-    return servletsModuleBuilder.serveRegex(Lists.newArrayList(regex, regexes));
+    return servletsModuleBuilder.serveRegex(ImmutableList.<String>builder().add(regex).add(regexes).build());
   }
 
   /**
diff --git a/extensions/servlet/src/com/google/inject/servlet/ServletScopes.java b/extensions/servlet/src/com/google/inject/servlet/ServletScopes.java
index c1f2f7b..fdbeacc 100644
--- a/extensions/servlet/src/com/google/inject/servlet/ServletScopes.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ServletScopes.java
@@ -20,8 +20,8 @@
 import com.google.inject.OutOfScopeException;
 import com.google.inject.Provider;
 import com.google.inject.Scope;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Preconditions;
+import com.google.common.collect.Maps;
+import com.google.common.base.Preconditions;
 import java.util.Map;
 import java.util.concurrent.Callable;
 import javax.servlet.http.HttpServletRequest;
diff --git a/extensions/servlet/src/com/google/inject/servlet/ServletsModuleBuilder.java b/extensions/servlet/src/com/google/inject/servlet/ServletsModuleBuilder.java
index 3c14237..02e68ed 100755
--- a/extensions/servlet/src/com/google/inject/servlet/ServletsModuleBuilder.java
+++ b/extensions/servlet/src/com/google/inject/servlet/ServletsModuleBuilder.java
@@ -17,8 +17,8 @@
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Lists;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import com.google.inject.internal.UniqueAnnotations;
 import java.util.HashMap;
 import java.util.List;
diff --git a/extensions/servlet/test/com/google/inject/servlet/ContinuingRequestIntegrationTest.java b/extensions/servlet/test/com/google/inject/servlet/ContinuingRequestIntegrationTest.java
index befb549..7d07739 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ContinuingRequestIntegrationTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ContinuingRequestIntegrationTest.java
@@ -22,8 +22,8 @@
 import com.google.inject.Key;
 import com.google.inject.Provider;
 import com.google.inject.Singleton;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableMap;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
 import java.util.List;
 import java.util.concurrent.AbstractExecutorService;
diff --git a/extensions/servlet/test/com/google/inject/servlet/ExtensionSpiTest.java b/extensions/servlet/test/com/google/inject/servlet/ExtensionSpiTest.java
index 9087746..c567d70 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ExtensionSpiTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ExtensionSpiTest.java
@@ -28,8 +28,8 @@
 import com.google.inject.Guice;

 import com.google.inject.Injector;

 import com.google.inject.Key;

-import com.google.inject.internal.util.ImmutableList;

-import com.google.inject.internal.util.ImmutableMap;

+import com.google.common.collect.ImmutableList;

+import com.google.common.collect.ImmutableMap;

 import com.google.inject.name.Names;

 import com.google.inject.servlet.ServletSpiVisitor.Params;

 import com.google.inject.spi.Element;

diff --git a/extensions/servlet/test/com/google/inject/servlet/FilterDefinitionTest.java b/extensions/servlet/test/com/google/inject/servlet/FilterDefinitionTest.java
index f11d84f..12913dd 100644
--- a/extensions/servlet/test/com/google/inject/servlet/FilterDefinitionTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/FilterDefinitionTest.java
@@ -3,8 +3,8 @@
 import com.google.inject.Binding;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.BindingScopingVisitor;
 import java.io.IOException;
 import java.util.Enumeration;
diff --git a/extensions/servlet/test/com/google/inject/servlet/ScopeRequestIntegrationTest.java b/extensions/servlet/test/com/google/inject/servlet/ScopeRequestIntegrationTest.java
index 75be749..1302c86 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ScopeRequestIntegrationTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ScopeRequestIntegrationTest.java
@@ -24,8 +24,8 @@
 import com.google.inject.Provider;
 import com.google.inject.ProvisionException;
 import com.google.inject.Singleton;
-import com.google.inject.internal.util.ImmutableMap;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 
diff --git a/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionPathsTest.java b/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionPathsTest.java
index 111395f..ab894be 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionPathsTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionPathsTest.java
@@ -19,8 +19,8 @@
 import com.google.inject.Binding;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.BindingScopingVisitor;
 import java.io.IOException;
 import java.util.HashMap;
diff --git a/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionTest.java b/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionTest.java
index 7a08937..e201f87 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ServletDefinitionTest.java
@@ -20,8 +20,8 @@
 import com.google.inject.Injector;
 import com.google.inject.Key;
 import com.google.inject.spi.BindingScopingVisitor;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
diff --git a/extensions/servlet/test/com/google/inject/servlet/ServletModuleTest.java b/extensions/servlet/test/com/google/inject/servlet/ServletModuleTest.java
index ca1089c..6fd04de 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ServletModuleTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ServletModuleTest.java
@@ -23,7 +23,7 @@
 import com.google.inject.Binding;

 import com.google.inject.Guice;

 import com.google.inject.Injector;

-import com.google.inject.internal.util.Lists;

+import com.google.common.collect.Lists;

 import com.google.inject.spi.DefaultBindingTargetVisitor;

 import com.google.inject.spi.Elements;

 

diff --git a/extensions/servlet/test/com/google/inject/servlet/ServletPipelineRequestDispatcherTest.java b/extensions/servlet/test/com/google/inject/servlet/ServletPipelineRequestDispatcherTest.java
index 37709b5..e994856 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ServletPipelineRequestDispatcherTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ServletPipelineRequestDispatcherTest.java
@@ -21,9 +21,9 @@
 import com.google.inject.Key;
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.Maps;
-import com.google.inject.internal.util.Sets;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.google.inject.spi.BindingScopingVisitor;
 import com.google.inject.util.Providers;
 
diff --git a/extensions/servlet/test/com/google/inject/servlet/ServletSpiVisitor.java b/extensions/servlet/test/com/google/inject/servlet/ServletSpiVisitor.java
index 0a2ec59..f39ad6e 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ServletSpiVisitor.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ServletSpiVisitor.java
@@ -35,10 +35,9 @@
 import com.google.inject.Binding;

 import com.google.inject.Injector;

 import com.google.inject.Stage;

-import com.google.inject.internal.util.ImmutableSet;

-import com.google.inject.internal.util.Lists;

-import com.google.inject.internal.util.Objects;

-import com.google.inject.internal.util.ToStringBuilder;

+import com.google.common.collect.ImmutableSet;

+import com.google.common.collect.Lists;

+import com.google.common.base.Objects;

 import com.google.inject.spi.DefaultBindingTargetVisitor;

 

 /**

@@ -140,7 +139,7 @@
     

     @Override

     public String toString() {

-      return new ToStringBuilder(Params.class)

+      return Objects.toStringHelper(Params.class)

         .add("pattern", pattern)

         .add("keyOrInstance", keyOrInstance)

         .add("initParams", params)

diff --git a/extensions/servlet/test/com/google/inject/servlet/ServletTest.java b/extensions/servlet/test/com/google/inject/servlet/ServletTest.java
index 91626f8..cab6ab0 100644
--- a/extensions/servlet/test/com/google/inject/servlet/ServletTest.java
+++ b/extensions/servlet/test/com/google/inject/servlet/ServletTest.java
@@ -35,7 +35,7 @@
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-import com.google.inject.internal.util.Maps;
+import com.google.common.collect.Maps;
 import com.google.inject.servlet.RequestParameters;
 import com.google.inject.util.Providers;
 
diff --git a/extensions/spring/build.xml b/extensions/spring/build.xml
index 6f0d4e4..16c8299 100644
--- a/extensions/spring/build.xml
+++ b/extensions/spring/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/spring/src/com/google/inject/spring/SpringIntegration.java b/extensions/spring/src/com/google/inject/spring/SpringIntegration.java
index 7e23cb8..44909dd 100644
--- a/extensions/spring/src/com/google/inject/spring/SpringIntegration.java
+++ b/extensions/spring/src/com/google/inject/spring/SpringIntegration.java
@@ -19,7 +19,7 @@
 import com.google.inject.Binder;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.name.Names;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.ListableBeanFactory;
diff --git a/extensions/struts2/build.xml b/extensions/struts2/build.xml
index dbd5f2d..820dfa2 100644
--- a/extensions/struts2/build.xml
+++ b/extensions/struts2/build.xml
@@ -11,7 +11,7 @@
     <fileset dir="../servlet/build" includes="*.jar"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/throwingproviders/build.xml b/extensions/throwingproviders/build.xml
index e9b55d3..9d36431 100644
--- a/extensions/throwingproviders/build.xml
+++ b/extensions/throwingproviders/build.xml
@@ -10,7 +10,7 @@
     <pathelement path="../../build/classes"/>
   </path>
 
-  <target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
+  <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
     <jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
         manifest="${build.dir}/META-INF/MANIFEST.MF">
       <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
diff --git a/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethod.java b/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethod.java
index de345c6..e054267 100644
--- a/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethod.java
+++ b/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethod.java
@@ -29,7 +29,7 @@
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
 import com.google.inject.binder.ScopedBindingBuilder;
-import com.google.inject.internal.util.ImmutableSet;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.internal.util.StackTraceElements;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.HasDependencies;
diff --git a/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethodsModule.java b/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethodsModule.java
index 335bc48..e6d4d43 100644
--- a/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethodsModule.java
+++ b/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProviderMethodsModule.java
@@ -24,9 +24,9 @@
 import com.google.inject.internal.Annotations;
 import com.google.inject.internal.Errors;
 import com.google.inject.internal.UniqueAnnotations;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.Message;
 import com.google.inject.util.Modules;
diff --git a/extensions/throwingproviders/src/com/google/inject/throwingproviders/ThrowingProviderBinder.java b/extensions/throwingproviders/src/com/google/inject/throwingproviders/ThrowingProviderBinder.java
index 0dbbdf1..ac4e454 100644
--- a/extensions/throwingproviders/src/com/google/inject/throwingproviders/ThrowingProviderBinder.java
+++ b/extensions/throwingproviders/src/com/google/inject/throwingproviders/ThrowingProviderBinder.java
@@ -22,11 +22,11 @@
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
 import com.google.inject.binder.ScopedBindingBuilder;
-import static com.google.inject.internal.util.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.inject.internal.UniqueAnnotations;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Lists;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
 import com.google.inject.spi.Dependency;
 import com.google.inject.spi.ProviderWithDependencies;
 import com.google.inject.util.Types;
diff --git a/extensions/throwingproviders/test/com/google/inject/throwingproviders/CheckedProviderTest.java b/extensions/throwingproviders/test/com/google/inject/throwingproviders/CheckedProviderTest.java
index 544484f..45c9a59 100644
--- a/extensions/throwingproviders/test/com/google/inject/throwingproviders/CheckedProviderTest.java
+++ b/extensions/throwingproviders/test/com/google/inject/throwingproviders/CheckedProviderTest.java
@@ -26,10 +26,10 @@
 import com.google.inject.Key;
 import com.google.inject.TypeLiteral;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.Function;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import com.google.inject.spi.Dependency;
diff --git a/extensions/throwingproviders/test/com/google/inject/throwingproviders/ThrowingProviderTest.java b/extensions/throwingproviders/test/com/google/inject/throwingproviders/ThrowingProviderTest.java
index 60c6914..d3a6834 100644
--- a/extensions/throwingproviders/test/com/google/inject/throwingproviders/ThrowingProviderTest.java
+++ b/extensions/throwingproviders/test/com/google/inject/throwingproviders/ThrowingProviderTest.java
@@ -25,10 +25,10 @@
 import com.google.inject.Key;
 import com.google.inject.TypeLiteral;
 import com.google.inject.internal.util.Classes;
-import com.google.inject.internal.util.Function;
-import com.google.inject.internal.util.ImmutableList;
-import com.google.inject.internal.util.ImmutableSet;
-import com.google.inject.internal.util.Iterables;
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
 import com.google.inject.name.Named;
 import com.google.inject.name.Names;
 import com.google.inject.spi.Dependency;
diff --git a/lib/build/guava-r09.jar b/lib/build/guava-r09.jar
new file mode 100644
index 0000000..f8da8b1
--- /dev/null
+++ b/lib/build/guava-r09.jar
Binary files differ
diff --git a/lib/build/jarjar-snapshot.jar b/lib/build/jarjar-1.1.jar
similarity index 83%
rename from lib/build/jarjar-snapshot.jar
rename to lib/build/jarjar-1.1.jar
index 9e98941..352c00a 100644
--- a/lib/build/jarjar-snapshot.jar
+++ b/lib/build/jarjar-1.1.jar
Binary files differ
diff --git a/pom.xml b/pom.xml
index e47cc85..001892b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -221,12 +221,12 @@
                 <result>com.google.inject.internal.asm.@1.$@2</result>
               </rule>
               <rule>
-                <pattern>com.google.inject.internal.util.*</pattern>
-                <result>com.google.inject.internal.util.$@1</result>
+                <pattern>com.google.common.*</pattern>
+                <result>com.google.inject.internal.guava.$@1</result>
               </rule>
               <rule>
-                <pattern>com.google.inject.internal.util.**.*</pattern>
-                <result>com.google.inject.internal.util.@1.$@2</result>
+                <pattern>com.google.common.**.*</pattern>
+                <result>com.google.inject.internal.guava.@1.$@2</result>
               </rule>
               <keep>
                 <pattern>com.google.inject.**</pattern>