### Question:
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);  }### Answer:
@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); }
@Test public void booleansToInt_1538(){ boolean [] testCase = new boolean[] { false, true, false, false, false, false, false, false, false, true, true, false}; int expected = 1538; int actual = Utility.booleansToInt(testCase); Assert.assertEquals(expected, actual); }