mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-08-01 18:49:39 +08:00
21 lines
592 B
Java
21 lines
592 B
Java
package com.thealgorithms.bitmanipulation;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
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));
|
|
}
|
|
}
|