### Question:
TypeScriptUtils { static String getEnumVariants(Collection<String> values) { return values.stream() .sorted() .map(value -> StringUtils.escapeJavaString(value, "")) .collect(Collectors.joining(" | ")); } private  TypeScriptUtils();   }### Answer:
@Test public void createsEnumVariantsFromString() { assertThat(TypeScriptUtils.getEnumVariants(Arrays.asList("foo", "bar")), equalTo("\"bar\" | \"foo\"")); assertThat(TypeScriptUtils.getEnumVariants(Arrays.asList("foo!!")), equalTo("\"foo!!\"")); assertThat(TypeScriptUtils.getEnumVariants(Arrays.asList("foo\"", "bar")), equalTo("\"bar\" | \"foo\\\"\"")); }