### Question:
PropertyUtils { public static boolean booleanProperty(Configuration conf, Property property) { return conf.getBoolean(property.key(), (boolean) property.defaultValue()); } private  PropertyUtils(); static String stringProperty(Configuration conf, Property property); static boolean booleanProperty(Configuration conf, Property property); static int intProperty(Configuration conf, Property property); static long longProperty(Configuration conf, Property property);  }### Answer:
@Test public void booleanPropertyPropertyReturnsConfValue() { when(property.key()).thenReturn(BOOLEAN_PROPERTY); when(property.defaultValue()).thenReturn(false); assertThat(booleanProperty(conf, property)).isTrue(); }
@Test public void booleanPropertyPropertyReturnsDefaultValue() { when(property.key()).thenReturn("unset"); when(property.defaultValue()).thenReturn(false); assertThat(booleanProperty(conf, property)).isFalse(); }
@Test(expected = NullPointerException.class) public void booleanPropertyPropertyThrowsNullPointerException() { when(property.key()).thenReturn("unset"); booleanProperty(conf, property); }