### Question:
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);  }### Answer:
@Test public void intToBooleans_0(){ int testInt = 0; boolean [] actual = new boolean[2]; boolean [] expected = new boolean[2]; Arrays.fill(expected, false); Utility.intToBooleans(testInt, actual); for(int i = 0; i < actual.length; ++i) { Assert.assertEquals(actual[i], expected[i]); } }
@Test public void intToBooleans_1(){ int testInt = 1; boolean [] actual = new boolean[2]; boolean [] expected = new boolean[] { true, false }; Utility.intToBooleans(testInt, actual); for(int i = 0; i < actual.length; ++i) { Assert.assertEquals(actual[i], expected[i]); } }
@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]); } }
@Test public void intToBooleans_3(){ int testInt = 3; boolean [] actual = new boolean[2]; boolean [] expected = new boolean[] { true, true}; Utility.intToBooleans(testInt, actual); for(int i = 0; i < actual.length; ++i) { Assert.assertEquals(actual[i], expected[i]); } }
@Test public void intToBooleans_1538(){ int testInt = 1538; boolean [] actual = new boolean[12]; boolean [] expected = new boolean[] { false, true, false, false, false, false, false, false, false, true, true, false}; Utility.intToBooleans(testInt, actual); for(int i = 0; i < actual.length; ++i) { Assert.assertEquals(actual[i], expected[i]); } }
@Test public void intToBooleans_clearInput(){ int testInt = 1538; boolean [] actual = new boolean[12]; Arrays.fill(actual, true); boolean [] expected = new boolean[] { false, true, false, false, false, false, false, false, false, true, true, false}; Utility.intToBooleans(testInt, actual); for(int i = 0; i < actual.length; ++i) { Assert.assertEquals(actual[i], expected[i]); } }