}
@Test
public void testSerializeCodeWScope() throws Exception {
BSONObject scope = new BasicBSONObject("t", 1);
CodeWScope object = new CodeWScope("function() {}", scope);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
objectOutputStream.writeObject(object);
ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
ObjectInputStream objectInputStream = new ObjectInputStream(inputStream);
CodeWScope object2 = (CodeWScope) objectInputStream.readObject();
assertEquals(object.getCode(), object2.getCode());
assertEquals(object.getScope().get("t"), object2.getScope().get("t"));
}