Move methods from others to correct packages (#6475)

refactor: Move methods from `others` package to their respective packages
This commit is contained in:
Deniz Altunkapan
2025-08-18 22:28:19 +02:00
committed by GitHub
parent 9f0dd37c5e
commit 6c24d27b03
4 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,44 @@
package com.thealgorithms.strings;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
class RemoveDuplicateFromStringTest {
@Test
void testEmptyString() {
assertEquals("", RemoveDuplicateFromString.removeDuplicate(""));
}
@Test
void testNullString() {
assertNull(RemoveDuplicateFromString.removeDuplicate(null));
}
@Test
void testSingleCharacterString() {
assertEquals("a", RemoveDuplicateFromString.removeDuplicate("a"));
}
@Test
void testStringWithNoDuplicates() {
assertEquals("abc", RemoveDuplicateFromString.removeDuplicate("abc"));
}
@Test
void testStringWithDuplicates() {
assertEquals("abcd", RemoveDuplicateFromString.removeDuplicate("aabbbccccddddd"));
}
@Test
void testStringWithAllSameCharacters() {
assertEquals("a", RemoveDuplicateFromString.removeDuplicate("aaaaa"));
}
@Test
void testStringWithMixedCase() {
assertEquals("abAB", RemoveDuplicateFromString.removeDuplicate("aabABAB"));
}
}