public static String stripSuffix(String string, String suffix) {
        int index = string.lastIndexOf(suffix);
        return index == -1 ? string : string.substring(0, index);
    }
@Test
    public void testStripSuffix() {
        assertEquals("abc", StringUtilities.stripSuffix("abc.def", ".def"));
        assertEquals("abc.def", StringUtilities.stripSuffix("abc.def", ""));
        assertTrue(StringUtilities.stripSuffix("", ".def").isEmpty());
        assertTrue(StringUtilities.stripSuffix("", "").isEmpty());
    }