refactor: unified duplicate Anagram classes into a single implementation (#6290)

This commit is contained in:
Deniz Altunkapan
2025-06-11 19:04:06 +02:00
committed by GitHub
parent 0b21bb0a38
commit 1745d19f09
9 changed files with 38 additions and 212 deletions

View File

@@ -0,0 +1,15 @@
package com.thealgorithms.strings;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
class CharactersSameTest {
@ParameterizedTest
@CsvSource({"aaa, true", "abc, false", "'1 1 1 1', false", "111, true", "'', true", "' ', true", "'. ', false", "'a', true", "' ', true", "'ab', false", "'11111', true", "'ababab', false", "' ', true", "'+++', true"})
void testIsAllCharactersSame(String input, boolean expected) {
assertEquals(CharactersSame.isAllCharactersSame(input), expected);
}
}