Enable PMD rule SimplifiableTestAssertion and fix violations
This commit is contained in:
parent
09a9c1a104
commit
b1a88b01ab
9 changed files with 25 additions and 30 deletions
|
|
@ -1,11 +1,11 @@
|
|||
package btools.util;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
public class CompactMapTest {
|
||||
@Test
|
||||
public void hashMapComparisonTest() {
|
||||
|
|
@ -48,8 +48,8 @@ public class CompactMapTest {
|
|||
String s = hmap.get(KK);
|
||||
|
||||
boolean contained = hmap.containsKey(KK);
|
||||
Assert.assertTrue("containsKey missmatch (slow)", contained == cmap_slow.contains(k));
|
||||
Assert.assertTrue("containsKey missmatch (fast)", contained == cmap_fast.contains(k));
|
||||
Assert.assertEquals("containsKey missmatch (slow)", contained, cmap_slow.contains(k));
|
||||
Assert.assertEquals("containsKey missmatch (fast)", contained, cmap_fast.contains(k));
|
||||
|
||||
if (contained) {
|
||||
Assert.assertEquals("object missmatch (fast)", s, cmap_fast.get(k));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue