diff --git a/src/com/google/testing/littlemock/LittleMock.java b/src/com/google/testing/littlemock/LittleMock.java
index c8f2b2f..efd205c 100644
--- a/src/com/google/testing/littlemock/LittleMock.java
+++ b/src/com/google/testing/littlemock/LittleMock.java
@@ -1011,18 +1011,6 @@
     return DEFAULT_RETURN_VALUE_LOOKUP.get(returnType);
   }
 
-  /**
-   * If the input object is one of our mocks, returns the {@link DefaultInvocationHandler}
-   * we constructed it with.  Otherwise fails with {@link IllegalArgumentException}.
-   */
-  private static DefaultInvocationHandler getHandlerFrom(Object mock) {
-    InvocationHandler invocationHandler = Proxy.getInvocationHandler(mock);
-    if (!(invocationHandler instanceof DefaultInvocationHandler)) {
-      throw new IllegalArgumentException("not a valid mock: " + mock);
-    }
-    return (DefaultInvocationHandler) invocationHandler;
-  }
-
   /** Gets a suitable class loader for use with the proxy. */
   private static ClassLoader getClassLoader() {
     return LittleMock.class.getClassLoader();
@@ -1042,6 +1030,28 @@
     }
   }
 
+  /**
+   * If the input object is one of our mocks, returns the {@link DefaultInvocationHandler}
+   * we constructed it with.  Otherwise fails with {@link IllegalArgumentException}.
+   */
+  private static DefaultInvocationHandler getHandlerFrom(Object mock) {
+    try {
+      InvocationHandler invocationHandler = Proxy.getInvocationHandler(mock);
+      if (invocationHandler instanceof DefaultInvocationHandler) {
+        return (DefaultInvocationHandler) invocationHandler;
+      }
+    } catch (IllegalArgumentException expectedIfNotAProxy) {}
+    try {
+      Class<?> proxyBuilder = Class.forName("com.google.dexmaker.stock.ProxyBuilder");
+      Method getHandlerMethod = proxyBuilder.getMethod("getInvocationHandler", Object.class);
+      Object invocationHandler = getHandlerMethod.invoke(proxyBuilder, mock);
+      if (invocationHandler instanceof DefaultInvocationHandler) {
+        return (DefaultInvocationHandler) invocationHandler;
+      }
+    } catch (Exception expectedIfNotAProxyBuilderMock) {}
+    throw new IllegalArgumentException("not a valid mock: " + mock);
+  }
+
   /** Create a dynamic proxy for the given class, delegating to the given invocation handler. */
   private static Object createProxy(Class<?> clazz, InvocationHandler handler) {
     if (clazz.isInterface()) {
diff --git a/tests/com/google/testing/littlemock/LittleMockTest.java b/tests/com/google/testing/littlemock/LittleMockTest.java
index e8c7b1e..fde8c7c 100644
--- a/tests/com/google/testing/littlemock/LittleMockTest.java
+++ b/tests/com/google/testing/littlemock/LittleMockTest.java
@@ -1413,13 +1413,14 @@
     } catch (IllegalStateException expected) {}
   }
 
-  public class Jim {
+  public static class Jim {
     public void bob() {
       fail();
     }
   }
 
-  public void testMockingConcreteClasses() throws Exception {
+  // Does not work on JVM, android only.
+  public void suppress_testMockingConcreteClasses() throws Exception {
     Jim mock = mock(Jim.class);
     mock.bob();
   }
