public static String parseContextUuid(String name, Long ledgerId) {
        if (ledgerId == null || name == null) {
            return null;
        }
        int pos = name.indexOf("-ledger-" + ledgerId);
        if (pos <= 0) {
            return null;
        }
        return name.substring(0, pos);
    }
@Test
    public void parseContextUuidTest() throws Exception {
        UUID id = UUID.randomUUID();
        long ledgerId = 123124;
        String key = DataBlockUtils.dataBlockOffloadKey(ledgerId, id);
        String keyIndex = DataBlockUtils.indexBlockOffloadKey(ledgerId, id);

        assertEquals(ledgerId, DataBlockUtils.parseLedgerId(key).longValue());
        assertEquals(ledgerId, DataBlockUtils.parseLedgerId(keyIndex).longValue());
        assertEquals(id.toString(), DataBlockUtils.parseContextUuid(key, ledgerId));
        assertEquals(id.toString(), DataBlockUtils.parseContextUuid(keyIndex, ledgerId));

        assertNull(DataBlockUtils.parseContextUuid(null, null));
        assertNull(DataBlockUtils.parseContextUuid(null, ledgerId));
        assertNull(DataBlockUtils.parseContextUuid("foo", null));
        assertNull(DataBlockUtils.parseContextUuid("-ledger-" + ledgerId, ledgerId));
        assertNull(DataBlockUtils.parseContextUuid("something" + ledgerId, ledgerId));
    }