### Question:
Strings { @Contract("!null,_->!null; null,_->null") public static String lastPart(@Nullable final String string, final char delimiter) { if (string == null) return null; int pos = string.lastIndexOf(delimiter); if (pos >= 0) { return string.substring(pos+1); } else { return string; } }  @SuppressWarnings({"StringEquality", "SimplifiableIfStatement"}) static boolean eq(final String str1, final String str2); @SuppressWarnings({"StringEquality", "SimplifiableIfStatement"}) static boolean eq(final String str1, final String str2, final boolean caseSensitive); @NotNull static String ensureStartsWith(@NotNull final String str, final char c); @NotNull static String ensureEndsWith(@NotNull final String str, final char c); @NotNull static String removeEnding(@NotNull final String str, @NotNull final String ending); @NotNull static String rtrim(@NotNull final String str); @NotNull static String replace(@NotNull final String where, @NotNull final String what, @NotNull final String with); @NotNull static String repeat(@NotNull final String what, @Nullable final String delimiter, int count); @Contract("null,_->false") static boolean matches(@Nullable final CharSequence string, @NotNull final Pattern pattern); @Contract("null,_,_->false") static boolean matches(@Nullable final CharSequence string, @NotNull final String pattern, boolean caseSensitive); @Contract("!null->!null; null->null") static String upper(@Nullable final String string); @Contract("!null->!null; null->null") static String lower(@Nullable final String string); @Contract("!null->!null; null->null") static String minimizeSpaces(@Nullable final String string); @Contract("!null,_->!null; null,_->null") static String lastPart(@Nullable final String string, final char delimiter);  }### Answer:
@Test public void lastPart_basic() { assertThat(lastPart("aaa.bbb.ccc", '.')).isEqualTo("ccc"); assertThat(lastPart("dddd", '.')).isEqualTo("dddd"); assertThat(lastPart("", '.')).isEqualTo(""); assertThat(lastPart(null, '.')).isNull(); }
@Test public void lastPart_same() { final String s = "dddd"; assertThat(lastPart(s, '.')).isSameAs(s); }
@Test public void lastPart_delimiterAtTheEnd() { final String s = "word/"; assertThat(lastPart(s, '/')).isEqualTo(""); }