public static String stripEnd(final String str, final String stripChars) {
        int end;
        if (str == null || (end = str.length()) == 0) {
            return str;
        }

        if (stripChars == null) {
            while (end != 0 && Character.isWhitespace(str.charAt(end - 1))) {
                end--;
            }
        } else if (stripChars.isEmpty()) {
            return str;
        } else {
            while (end != 0 && stripChars.indexOf(str.charAt(end - 1)) != INDEX_NOT_FOUND) {
                end--;
            }
        }
        return str.substring(0, end);
    }
@Test
    void testStripEnd() throws Exception {
        assertThat(StringUtils.stripEnd(null, "*"), nullValue());
        assertThat(StringUtils.stripEnd("", null), equalTo(""));
        assertThat(StringUtils.stripEnd("abc", ""), equalTo("abc"));
        assertThat(StringUtils.stripEnd("abc", null), equalTo("abc"));
        assertThat(StringUtils.stripEnd("  abc", null), equalTo("  abc"));
        assertThat(StringUtils.stripEnd("abc  ", null), equalTo("abc"));
        assertThat(StringUtils.stripEnd(" abc ", null), equalTo(" abc"));
        assertThat(StringUtils.stripEnd("  abcyx", "xyz"), equalTo("  abc"));
        assertThat(StringUtils.stripEnd("120.00", ".0"), equalTo("12"));
    }