public static void validateGroupInstanceId(String id) {
        Topic.validate(id, "Group instance id", message -> {
            throw new InvalidConfigurationException(message);
        });
    }
@Test
    public void shouldThrowOnInvalidGroupInstanceIds() {
        char[] longString = new char[250];
        Arrays.fill(longString, 'a');
        String[] invalidGroupInstanceIds = {"", "foo bar", "..", "foo:bar", "foo=bar", ".", new String(longString)};

        for (String instanceId : invalidGroupInstanceIds) {
            try {
                JoinGroupRequest.validateGroupInstanceId(instanceId);
                fail("No exception was thrown for invalid instance id: " + instanceId);
            } catch (InvalidConfigurationException e) {
                // Good
            }
        }
    }