public static String resolveRaw(String str) {
        int len = str.length();
        if (len <= 4) {
            return null;
        }

        int endPos = len - 1;
        char last = str.charAt(endPos);

        // optimize to not create new objects
        if (last == ')') {
            char char1 = str.charAt(0);
            char char2 = str.charAt(1);
            char char3 = str.charAt(2);
            char char4 = str.charAt(3);
            if (char1 == 'R' && char2 == 'A' && char3 == 'W' && char4 == '(') {
                return str.substring(4, endPos);
            }
        } else if (last == '}') {
            char char1 = str.charAt(0);
            char char2 = str.charAt(1);
            char char3 = str.charAt(2);
            char char4 = str.charAt(3);
            if (char1 == 'R' && char2 == 'A' && char3 == 'W' && char4 == '{') {
                return str.substring(4, endPos);
            }
        }

        // not RAW value
        return null;
    }
@Test
    void testURIScannerType2() {
        final String resolvedRaw1 = URIScanner.resolveRaw("RAW{++?w0rd}");
        Assertions.assertEquals("++?w0rd", resolvedRaw1);
    }