We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d784b9 commit 039414eCopy full SHA for 039414e
src/test/java/com/thealgorithms/bitmanipulation/CountSetBitsTest.java
@@ -0,0 +1,17 @@
1
+// CountSetBitsTest.java
2
+package com.thealgorithms.bitmanipulation;
3
+
4
+import static org.junit.jupiter.api.Assertions.assertEquals;
5
6
+import org.junit.jupiter.api.Test;
7
8
+public class CountSetBitsTest {
9
+ @Test
10
+ void testCountSetBits() {
11
+ assertEquals(0, CountSetBits.countSetBits(0));
12
+ assertEquals(1, CountSetBits.countSetBits(1));
13
+ assertEquals(2, CountSetBits.countSetBits(5));
14
+ assertEquals(3, CountSetBits.countSetBits(7));
15
+ assertEquals(4, CountSetBits.countSetBits(15));
16
+ }
17
+}
0 commit comments