EndingWithMatcher extends AbstractSimpleStringMatcher { @Override protected boolean matches(String actual, String argument) { return actual != null && argument != null && actual.toLowerCase().endsWith(argument.toLowerCase()); }    }
@Test public void testWhenActualIsNull() { assertThat(new EndingWithMatcher().matches(null, ""), is(false)); }
@Test public void testWhenParameterIsNull() { assertThat(new EndingWithMatcher().matches("", null), is(false)); }
@Test public void testWhenBothAreNull() { assertThat(new EndingWithMatcher().matches(null, null), is(false)); }
@Test public void testWhenActualDoesNotEndWithParameter() { assertThat(new EndingWithMatcher().matches("xyz", "abc"), is(false)); }
@Test public void testWhenActualEndsWithParameter() { assertThat(new EndingWithMatcher().matches("HelloWorld", "WORLD"), is(true)); }