From accc34250e3b1a49522bc3d96d056a7a0c99c4bf Mon Sep 17 00:00:00 2001 From: "Capt. Cutlass" <5120290+ParanoidUser@users.noreply.github.com> Date: Thu, 19 Jun 2025 12:03:54 -0400 Subject: [PATCH] refactor: revise obsolete kata logic Method name has changed from `second_symbol` to `secondSymbol`. --- .../main/SecondOcurrence.java | 2 +- .../test/SolutionTest.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/main/SecondOcurrence.java b/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/main/SecondOcurrence.java index d2506ede4..cbeffc58f 100644 --- a/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/main/SecondOcurrence.java +++ b/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/main/SecondOcurrence.java @@ -1,5 +1,5 @@ interface SecondOcurrence { - static int second_symbol(String str, char c) { + static int secondSymbol(String str, char c) { return str.indexOf(c, str.indexOf(c) + 1); } } \ No newline at end of file diff --git a/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/test/SolutionTest.java b/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/test/SolutionTest.java index 6c0b5f6bd..23f9126d6 100644 --- a/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/test/SolutionTest.java +++ b/kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string/test/SolutionTest.java @@ -5,10 +5,10 @@ class SolutionTest { @Test void sample() { - assertEquals(3, SecondOcurrence.second_symbol("Hello world!!!", 'l')); - assertEquals(7, SecondOcurrence.second_symbol("Hello world!!!", 'o')); - assertEquals(-1, SecondOcurrence.second_symbol("Hello world!!!", 'A')); - assertEquals(-1, SecondOcurrence.second_symbol("Hello", '!')); - assertEquals(-1, SecondOcurrence.second_symbol("", 'q')); + assertEquals(3, SecondOcurrence.secondSymbol("Hello world!!!", 'l')); + assertEquals(7, SecondOcurrence.secondSymbol("Hello world!!!", 'o')); + assertEquals(-1, SecondOcurrence.secondSymbol("Hello world!!!", 'A')); + assertEquals(-1, SecondOcurrence.secondSymbol("Hello", '!')); + assertEquals(-1, SecondOcurrence.secondSymbol("", 'q')); } } \ No newline at end of file