StringBuilderUtils { public static boolean startsWith(@NonNull StringBuilder stringBuilder, @NonNull String start) { return stringBuilder.indexOf(start) == 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 startsWith_SingleCharacter() { StringBuilder stringBuilder = new StringBuilder("1234567890"); Assert.assertTrue(StringBuilderUtils.startsWith(stringBuilder, "1")); Assert.assertFalse(StringBuilderUtils.startsWith(stringBuilder, "2")); }
@Test public void startsWith_MultipleCharacters() { StringBuilder stringBuilder = new StringBuilder("1234567890"); Assert.assertTrue(StringBuilderUtils.startsWith(stringBuilder, "12345")); Assert.assertFalse(StringBuilderUtils.startsWith(stringBuilder, "23456")); }