public static String normalize(String string) {
        if (string == null) {
            return null;
        }

        if (string.length() > 63) {
            string = string.substring(0, 63);
        }

        string = StringUtils.stripEnd(string, "-");
        string = StringUtils.stripEnd(string, ".");
        string = StringUtils.stripEnd(string, "_");

        return string;
    }
@Test
    void normalize() {
        assertThat(ScriptService.normalize(null), nullValue());
        assertThat(ScriptService.normalize("a-normal-string"), is("a-normal-string"));
        assertThat(ScriptService.normalize("very.very.very.very.very.very.very.very.very.very.very.very.long.namespace"), is("very.very.very.very.very.very.very.very.very.very.very.very.lon"));
    }