### Question:
InterfaceProxyFactory extends ProxyFactory { @SuppressWarnings("unchecked") public <T> T createProxy(T obj, final InvocationHandler handler) { Class<?> c = obj.getClass(); Class<?>[] interfaces = c.getInterfaces(); if (interfaces.length == 0) { throw new IllegalArgumentException( "Can not create a proxy using the " + InterfaceProxyFactory.class.getSimpleName() + ", because the class " + c.getName() + " does not implement any interfaces"); } return (T) Proxy.newProxyInstance(c.getClassLoader(), interfaces, handler); }  static InterfaceProxyFactory getInstance(); @SuppressWarnings("unchecked") T createProxy(T obj, final InvocationHandler handler);  }### Answer:
@Test public void testObject() { new AssertThrows(new IllegalArgumentException( "Can not create a proxy using the InterfaceProxyFactory, " + "because the class java.lang.Object does not implement any interfaces")) { public void test() { createProxy(new Object()).equals(null); }}; }
@Test public void testJavaUtilList() { List<String> list = new ArrayList<String>(); createProxy(list).size(); assertEquals("size = 0", buff.toString()); }