### Question:
ZooCachePropertyAccessor { String get(Property property, String path, AccumuloConfiguration parent) { String key = property.getKey(); String value = get(path + "/" + key); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", key, property.getType(), value); } if (parent != null) { value = parent.get(property); } } return value; } ZooCachePropertyAccessor(ZooCache propCache);   }### Answer:
@Test public void testGet_Valid() { expect(zc.get(FULL_PATH)).andReturn(VALUE_BYTES); replay(zc); assertEquals(VALUE, a.get(PROP, PATH, null)); }
@Test public void testGet_Parent() { AccumuloConfiguration parent = createMock(AccumuloConfiguration.class); expect(parent.get(PROP)).andReturn(VALUE); replay(parent); expect(zc.get(FULL_PATH)).andReturn(null); replay(zc); assertEquals(VALUE, a.get(PROP, PATH, parent)); }
@Test public void testGet_Parent_Null() { AccumuloConfiguration parent = createMock(AccumuloConfiguration.class); expect(parent.get(PROP)).andReturn(null); replay(parent); expect(zc.get(FULL_PATH)).andReturn(null); replay(zc); assertNull(a.get(PROP, PATH, parent)); }
@Test public void testGet_Null_NoParent() { expect(zc.get(FULL_PATH)).andReturn(null); replay(zc); assertNull(a.get(PROP, PATH, null)); }
@Test public void testGet_InvalidFormat() { Property badProp = Property.MASTER_CLIENTPORT; expect(zc.get(PATH + "/" + badProp.getKey())).andReturn(VALUE_BYTES); replay(zc); AccumuloConfiguration parent = createMock(AccumuloConfiguration.class); expect(parent.get(badProp)).andReturn("12345"); replay(parent); assertEquals("12345", a.get(badProp, PATH, parent)); }