### Question:
PropertyUtils { public static long longProperty(Configuration conf, Property property) { return conf.getLong(property.key(), (long) 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 longPropertyReturnsConfValue() { when(property.key()).thenReturn(LONG_PROPERTY); when(property.defaultValue()).thenReturn(1234567890L); assertThat(longProperty(conf, property)).isEqualTo(18000L); }
@Test public void longPropertyReturnsDefaultValue() { when(property.key()).thenReturn("unset"); when(property.defaultValue()).thenReturn(1234567890L); assertThat(longProperty(conf, property)).isEqualTo(1234567890L); }
@Test(expected = NullPointerException.class) public void longPropertyThrowsNullPointerException() { when(property.key()).thenReturn("unset"); longProperty(conf, property); }