### Question:
BitUtil { public static long setLongBit(long source, int pos, boolean value) { if (getLongBit(source, pos) == value) return source; pos = pos - 1; long bitValue = 1 << pos; if (value) { return source | bitValue; } else { return source ^ bitValue; } }  static String int2Bin(int source); static int bin2Int(String source); static String long2Bin(long source); static long bin2Long(String source); static boolean getIntBit(int source, int pos); static int setIntBit(int source, int pos, boolean value); static boolean getLongBit(long source, int pos); static long setLongBit(long source, int pos, boolean value);  }### Answer:
@Test public void setLongBit() { assertEquals("1011", BitUtil.long2Bin(BitUtil.setLongBit(BitUtil.bin2Long("1011"), 2, true))); assertEquals("1011", BitUtil.long2Bin(BitUtil.setLongBit(BitUtil.bin2Long("1001"), 2, true))); assertEquals("1001", BitUtil.long2Bin(BitUtil.setLongBit(BitUtil.bin2Long("1011"), 2, false))); assertEquals("1001", BitUtil.long2Bin(BitUtil.setLongBit(BitUtil.bin2Long("1001"), 2, false))); }