mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 06:55:02 +08:00
Add Index Of Right Most Set Bit Test (#4325)
* add Index Of Right Most Set Bit Test * clang linter solved
This commit is contained in:

committed by
GitHub

parent
4bcddd323c
commit
52f365a915
@ -0,0 +1,20 @@
|
||||
package com.thealgorithms.bitmanipulation;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test case for Index Of Right Most SetBit
|
||||
* @author Bama Charan Chhandogi (https://github.com/BamaCharanChhandogi)
|
||||
*/
|
||||
|
||||
class IndexOfRightMostSetBitTest {
|
||||
|
||||
@Test
|
||||
void testIndexOfRightMostSetBit() {
|
||||
assertEquals(3, IndexOfRightMostSetBit.indexOfRightMostSetBit(40));
|
||||
assertEquals(-1, IndexOfRightMostSetBit.indexOfRightMostSetBit(0));
|
||||
assertEquals(3, IndexOfRightMostSetBit.indexOfRightMostSetBit(-40));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user