### Question:
TinyDB { public static Boolean[] getBooleanArray( SharedPreferences preferences, String key, Boolean[] defaultValue) { String prefValue = preferences.getString(key, ""); if (prefValue.equals("")) { return defaultValue; } String[] temp = TextUtils.split(prefValue, DIVIDER); Boolean[] newArray = new Boolean[temp.length]; for (int i = 0; i < temp.length; i++) newArray[i] = Boolean.valueOf(temp[i]); return newArray; }  static void putBooleanArray(SharedPreferences preferences, String key, Boolean[] array); static Boolean[] getBooleanArray(
      SharedPreferences preferences, String key, Boolean[] defaultValue);  }### Answer:
@Test public void testLoadBooleanArrayShouldReturnDefaultValue() { Boolean[] expected = TinyDB.getBooleanArray( prefs, "foobaz", new Boolean[] {true, false, true, false, false, false}); Boolean[] result = TinyDB.getBooleanArray(prefs, "foobaz", expected); assertArrayEquals(expected, result); }
@Test public void testLoadBooleanArrayShouldReturnDefaultValue2() { assertNull(TinyDB.getBooleanArray(prefs, "foobam", null)); }