public static byte[] getDecodedId(String groupId) throws IOException { if (!isEncodedGroup(groupId)) { throw new IOException("Invalid encoding"); } return Hex.fromStringCondensed(groupId.split("!", 2)[1]); }