Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Resolving PR checks issues
  • Loading branch information
miladsade96 committed Sep 29, 2025
commit cf64388f85d58b59ee32f8d8fe5d6dbbaa570873
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public final class AlternativeStringArrange {

// Private constructor to prevent instantiation
private AlternativeStringArrange() {
throw new IllegalStateException("Utility class");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand All @@ -21,17 +20,4 @@ private static Stream<Object[]> provideTestData() {
void arrangeTest(String input1, String input2, String expected) {
assertEquals(expected, AlternativeStringArrange.arrange(input1, input2));
}

// Testing private constructor to prevent instantiation
@Test
void preventInstantiationTest() {
try {
var constructor = AlternativeStringArrange.class.getDeclaredConstructor();
constructor.setAccessible(true);
constructor.newInstance();
} catch (Exception e) {
assertEquals(IllegalStateException.class, e.getCause().getClass());
assertEquals("Utility class", e.getCause().getMessage());
}
}
}