public static String stripTillLastOccurrenceOf(String input, String pattern) {
        if (!StringUtils.isBlank(input) && !StringUtils.isBlank(pattern)) {
            int index = input.lastIndexOf(pattern);
            if (index > 0) {
                input = input.substring(index + pattern.length());
            }
        }
        return input;
    }
@Test
    public void shouldStripTillLastOccurrenceOfGivenString() {
        assertThat(stripTillLastOccurrenceOf("HelloWorld@@\\nfoobar\\nquux@@keep_this", "@@"), is("keep_this"));
        assertThat(stripTillLastOccurrenceOf("HelloWorld", "@@"), is("HelloWorld"));
        assertThat(stripTillLastOccurrenceOf(null, "@@"), is(nullValue()));
        assertThat(stripTillLastOccurrenceOf("HelloWorld", null), is("HelloWorld"));
        assertThat(stripTillLastOccurrenceOf(null, null), is(nullValue()));
        assertThat(stripTillLastOccurrenceOf("", "@@"), is(""));
    }