Branchless { public static int ifEquals(int x, int y, int a, int b) { return onEqu1(x, y, a, b, ((x-y)-1)>>31); }  static int ifEquals(int x, int y, int a, int b); static int ifZero(int x, int a, int b);  }
@Test public void simpleTest() { int x; int y; int a=1; int b=2; x=4; y=4; assertEquals(a, Branchless.ifEquals(x, y, a, b)); x=-3; y=-4; assertEquals(b, Branchless.ifEquals(x, y, a, b)); }