--- jsr166/src/test/tck/JSR166TestCase.java 2011/05/30 22:42:22 1.86 +++ jsr166/src/test/tck/JSR166TestCase.java 2011/05/30 22:53:21 1.87 @@ -1181,10 +1181,11 @@ public class JSR166TestCase extends Test oos.writeObject(o); oos.flush(); oos.close(); - ByteArrayInputStream bin = - new ByteArrayInputStream(bos.toByteArray()); - ObjectInputStream ois = new ObjectInputStream(bin); - return (T) ois.readObject(); + ObjectInputStream ois = new ObjectInputStream + (new ByteArrayInputStream(bos.toByteArray())); + T clone = (T) ois.readObject(); + assertSame(o.getClass(), clone.getClass()); + return clone; } catch (Throwable t) { threadUnexpectedException(t); return null;