diff --git a/core-java/src/test/java/com/baeldung/string/StringTest.java b/core-java/src/test/java/com/baeldung/string/StringTest.java index 324f4690fc..5bb4de27ee 100644 --- a/core-java/src/test/java/com/baeldung/string/StringTest.java +++ b/core-java/src/test/java/com/baeldung/string/StringTest.java @@ -38,7 +38,7 @@ public class StringTest { } @Test - public void whenGetBytesUsingUTF16_thenCorrect() { + public void whenGetBytesUsingASCII_thenCorrect() { byte[] byteArray = "efgh".getBytes(StandardCharsets.US_ASCII); byte[] expected = new byte[] { 101, 102, 103, 104 }; @@ -155,6 +155,13 @@ public class StringTest { String[] result = s.split("*"); } + + @Test + public void whenCallSubSequence_thenCorrect() { + String s = "Welcome to Baeldung"; + + assertEquals("Welcome", s.subSequence(0, 7)); + } @Test public void whenCallSubstring_thenCorrect() {