PathMapper implements Mapper { @Override public Object keyForTarget(DataObject target) { return getOrCreatePathExpression().evaluate(target); } PathMapper(String dbPath); @Override Expression expressionForKey(Object key); @Override Object keyForSource(RowProxy source); @Override Object keyForTarget(DataObject target); @Override String toString();  }
@Test public void testKeyForTarget() { DataObject t = mock(DataObject.class); when(t.readProperty("abc")).thenReturn(44); when(t.readNestedProperty("abc")).thenReturn(44); assertEquals(44, mapper.keyForTarget(t)); }