static BlobKey fromString(String stringRepresentation) {
        final String[] splits = stringRepresentation.split("-");

        Preconditions.checkState(
                splits.length == 3, "Blobs have to follow the format format (t|p)-key-random");

        final BlobType blobType;

        final char blobTypeCharacter = splits[0].charAt(0);
        switch (blobTypeCharacter) {
            case 't':
                blobType = TRANSIENT_BLOB;
                break;
            case 'p':
                blobType = PERMANENT_BLOB;
                break;
            default:
                throw new IllegalStateException(
                        String.format("Unknown blob type %s.", blobTypeCharacter));
        }

        final byte[] key = StringUtils.hexStringToByte(splits[1]);

        final byte[] random = StringUtils.hexStringToByte(splits[2]);

        return createKey(blobType, key, random);
    }
@Test
    void testFromStringFailsWithInvalidBlobKeyType() {
        assertThatThrownBy(
                        () ->
                                BlobKey.fromString(
                                        String.format(
                                                "x-%s-%s",
                                                StringUtils.byteToHexString(KEY_ARRAY_1),
                                                StringUtils.byteToHexString(RANDOM_ARRAY_1))))
                .isInstanceOf(IllegalStateException.class);
    }