ParcelFn { static byte[] marshall(Object o) { Parcel parcel = Parcel.obtain(); parcel.writeValue(o); byte[] result = parcel.marshall(); parcel.recycle(); return result; }    }
@Test public void testMarshall() throws Exception { assertEquals(1, ParcelFn.unmarshall(ParcelFn.marshall(1))); assertEquals("1", ParcelFn.unmarshall(ParcelFn.marshall("1"))); }
@Test(expected = Exception.class) public void testMarshallNotParcelable() throws Exception { ParcelFn.marshall(new Pair<>(1, 1)); }