StringBuilderUtils { public static boolean contains(@NonNull StringBuilder stringBuilder, @NonNull String contains) { return stringBuilder.indexOf(contains) >= 0; }  static void replace(@NonNull StringBuilder stringBuilder,
                        @NonNull String toReplace,
                        @NonNull String replacement); static void trim(@NonNull StringBuilder stringBuilder); static boolean isEmpty(@NonNull StringBuilder stringBuilder); static boolean startsWith(@NonNull StringBuilder stringBuilder, @NonNull String start); static boolean contains(@NonNull StringBuilder stringBuilder, @NonNull String contains); static boolean equals(@NonNull StringBuilder stringBuilder, @NonNull String equal); @NonNull static StringBuilder substring(@NonNull StringBuilder stringBuilder, int start, int end);  }
@Test public void contains_SingleCharacter() { StringBuilder stringBuilder = new StringBuilder("abcdefg123456"); Assert.assertFalse(StringBuilderUtils.contains(stringBuilder, "z")); for (int n = 0; n < stringBuilder.length(); n++) { Assert.assertTrue(StringBuilderUtils.contains(stringBuilder, String.valueOf(stringBuilder.charAt(n)))); } }
@Test public void contains_MultipleCharacters() { StringBuilder stringBuilder = new StringBuilder("abcdefg123456"); Assert.assertFalse(StringBuilderUtils.contains(stringBuilder, "cba")); Assert.assertFalse(StringBuilderUtils.contains(stringBuilder, "zyx")); }