public static Data toHeapData(Data data) {
        if (data == null || data instanceof HeapData) {
            return data;
        }
        return new HeapData(data.toByteArray());
    }
@Test
    public void toHeapData() throws Exception {
        Data data = ToHeapDataConverter.toHeapData(new AnotherDataImpl());
        assertInstanceOf(HeapData.class, data);
    }