public static Optional<LockType> getLockTypeFromEncoding(char encoding) {
    return Optional.ofNullable(PERSISTENCE_ENCODINGS.inverse().get(encoding));
  }
@Test
    public void testGetLockType() {
        assertEquals(LockType.SHARED_READ, LockTypeUtil.getLockTypeFromEncoding('r').get());
        assertEquals(LockType.SHARED_WRITE, LockTypeUtil.getLockTypeFromEncoding('w').get());
        assertEquals(LockType.EXCL_WRITE, LockTypeUtil.getLockTypeFromEncoding('x').get());
        assertEquals(LockType.EXCLUSIVE, LockTypeUtil.getLockTypeFromEncoding('e').get());
        assertFalse(LockTypeUtil.getLockTypeFromEncoding('y').isPresent());
    }