BeanPropertyExtractor implements PropertyExtractor<RECORD> { @Override public Object getValue(RECORD record, String propertyName) { ValueExtractor<RECORD> valueExtractor = getValueExtractor(record.getClass(), propertyName); return valueExtractor.extract(record); }  @Override Object getValue(RECORD record, String propertyName); BeanPropertyExtractor<RECORD> addProperty(String propertyName, ValueExtractor<RECORD> valueExtractor);  }
@Test public void testGetValue() throws Exception { BeanPropertyExtractor<Object> extractor = new BeanPropertyExtractor<>(); Object value = extractor.getValue(new A(), "q"); assertEquals("qValue", value); }
@Test public void testWontGetFieldValue() throws Exception { BeanPropertyExtractor<Object> extractor = new BeanPropertyExtractor<>(); Object value = extractor.getValue(new A(), "r"); assertNull(value); }
@Test public void testGetsBooleanGetter() throws Exception { BeanPropertyExtractor<Object> extractor = new BeanPropertyExtractor<>(); Object value = extractor.getValue(new A(), "s"); assertEquals(true, value); }