BlobHelper { public static byte[] serializeToBlob(Object obj) throws IOException { return serializeToBlob(obj, null); }  static byte[] serializeToBlob(Object obj); static byte[] serializeToBlob(Object obj, KnownVersion version); static void serializeTo(Object obj, HeapDataOutputStream hdos); static Object deserializeBlob(byte[] blob); static Object deserializeBlob(byte[] blob, KnownVersion version, ByteArrayDataInput in); static @Unretained Object deserializeOffHeapBlob(StoredObject blob); static Object deserializeBuffer(ByteArrayDataInput in, int numBytes);  }
@Test public void serializeToBlobMapReturnsBytesOfMap() throws Exception { byte[] bytes = serializeToBlob(this.mapWithTwoEntries); assertThat(bytes).isNotNull().isEqualTo(this.bytesOfMap); }
@Test public void serializeToBlobUnserializableThrowsNotSerializableException() throws Exception { assertThatThrownBy(() -> serializeToBlob(new Object())) .isExactlyInstanceOf(NotSerializableException.class).hasMessage(Object.class.getName()); }
@Test public void serializeToBlobWithNullReturnsBytesOfNull() throws Exception { byte[] bytes = serializeToBlob(null); assertThat(bytes).isNotNull().isEqualTo(this.bytesOfNull); }