@Test public void intToBooleans_2(){ int testInt = 2; boolean [] actual = new boolean[2]; boolean [] expected = new boolean[] { false, true}; Utility.intToBooleans(testInt, actual); for(int i = 0; i < actual.length; ++i) { Assert.assertEquals(actual[i], expected[i]); } }
public static void intToBooleans(int intValue, boolean [] booleans) { Arrays.fill(booleans, false); for(int i =0; i < booleans.length; i++) { if(((intValue >> i) & 1) == 1) { booleans[i] = true; } } }
Utility { public static void intToBooleans(int intValue, boolean [] booleans) { Arrays.fill(booleans, false); for(int i =0; i < booleans.length; i++) { if(((intValue >> i) & 1) == 1) { booleans[i] = true; } } } }
Utility { public static void intToBooleans(int intValue, boolean [] booleans) { Arrays.fill(booleans, false); for(int i =0; i < booleans.length; i++) { if(((intValue >> i) & 1) == 1) { booleans[i] = true; } } }  }
Utility { public static void intToBooleans(int intValue, boolean [] booleans) { Arrays.fill(booleans, false); for(int i =0; i < booleans.length; i++) { if(((intValue >> i) & 1) == 1) { booleans[i] = true; } } }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction); }
Utility { public static void intToBooleans(int intValue, boolean [] booleans) { Arrays.fill(booleans, false); for(int i =0; i < booleans.length; i++) { if(((intValue >> i) & 1) == 1) { booleans[i] = true; } } }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction);  }