### Question:
FastLog { public final static int log2(long v) { int r = 0; for (int i = 5; i >= 0; i--) { if ((v & b[i]) != 0) { v >>= S[i]; r |= S[i]; } } return r; }  final static int log2(long v); final static int log2(int v);  }### Answer:
@Test @Parameters public final void testLog2Long(int bitIndex, long longMSB) { Assert.assertEquals("log2(" + longMSB + ") != " + bitIndex, bitIndex, FastLog.log2(longMSB)); }
@Test @Parameters public final void testLog2Int(int bitIndex, int intMSB) { assertEquals("log2(" + intMSB + ") != " + bitIndex, bitIndex, FastLog.log2(intMSB)); }