public static String substringBefore(String s, String splitter) {
        int endIndex = s.indexOf(splitter);
        if (endIndex >= 0) {
            return s.substring(0, endIndex);
        }
        return s;
    }
@Test
    void testSubstringBeforeSplitterMultiChar() {
        assertThat(substringBefore("this is a test", " is ")).isEqualTo("this");
        assertThat(substringBefore("this is a test", " was ")).isEqualTo("this is a test");
    }