@Test public void booleansToInt_127(){ boolean [] testCase = new boolean[7]; Arrays.fill(testCase, true); int expected = 127; int actual = Utility.booleansToInt(testCase); Assert.assertEquals(expected, actual); }
public static int booleansToInt(boolean [] booleans) { int intValue = 0; for(int i =0; i < booleans.length; i++) { if(booleans[i]) { intValue += (1 << i); } } return intValue; }
Utility { public static int booleansToInt(boolean [] booleans) { int intValue = 0; for(int i =0; i < booleans.length; i++) { if(booleans[i]) { intValue += (1 << i); } } return intValue; } }
Utility { public static int booleansToInt(boolean [] booleans) { int intValue = 0; for(int i =0; i < booleans.length; i++) { if(booleans[i]) { intValue += (1 << i); } } return intValue; }  }
Utility { public static int booleansToInt(boolean [] booleans) { int intValue = 0; for(int i =0; i < booleans.length; i++) { if(booleans[i]) { intValue += (1 << i); } } return intValue; }  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 int booleansToInt(boolean [] booleans) { int intValue = 0; for(int i =0; i < booleans.length; i++) { if(booleans[i]) { intValue += (1 << i); } } return intValue; }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction);  }