ClassLoaderObjectInputStream extends ObjectInputStream { public ClassLoaderObjectInputStream( InputStream inputStream, ClassLoader classLoader) throws IOException { super(inputStream); _classLoader = classLoader; } ClassLoaderObjectInputStream(
			InputStream inputStream, ClassLoader classLoader);   }
@Test public void testClassLoaderObjectInputStream() throws Exception { TestSerializable testSerializable = new TestSerializable("test"); UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream(); try (ObjectOutputStream objectOutputStream = new ObjectOutputStream( unsyncByteArrayOutputStream)) { objectOutputStream.writeObject(testSerializable); objectOutputStream.flush(); } UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream( unsyncByteArrayOutputStream.unsafeGetByteArray()); try (ObjectInputStream objectInputStream = getObjectInputStream( unsyncByteArrayInputStream, ClassLoaderObjectInputStreamTest.class.getClassLoader())) { Assert.assertEquals( testSerializable, objectInputStream.readObject()); } }