Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@
<Match>
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL" />
</Match>
<Match>
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL" />
</Match>
<Match>
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" />
</Match>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.thealgorithms.ciphers;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -121,8 +122,8 @@ void testNullString() {
String decrypted = cipher.decrypt(encrypted, key);

// then
assertEquals(null, encrypted);
assertEquals(null, decrypted);
assertNull(encrypted);
assertNull(decrypted);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;

import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -30,7 +31,7 @@ public void searchAndNotFound() {
treap.insert(3);
treap.insert(8);
treap.insert(1);
assertEquals(null, treap.search(4));
assertNull(treap.search(4));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.thealgorithms.dynamicprogramming;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -55,27 +56,24 @@ public void testLCSWithBothEmptyStrings() {
public void testLCSWithNullFirstString() {
String str1 = null;
String str2 = "XYZ";
String expected = null; // Should return null if first string is null
String result = LongestCommonSubsequence.getLCS(str1, str2);
assertEquals(expected, result);
assertNull(result);
}

@Test
public void testLCSWithNullSecondString() {
String str1 = "ABC";
String str2 = null;
String expected = null; // Should return null if second string is null
String result = LongestCommonSubsequence.getLCS(str1, str2);
assertEquals(expected, result);
assertNull(result);
}

@Test
public void testLCSWithNullBothStrings() {
String str1 = null;
String str2 = null;
String expected = null; // Should return null if both strings are null
String result = LongestCommonSubsequence.getLCS(str1, str2);
assertEquals(expected, result);
assertNull(result);
}

@Test
Expand Down