MultiPathMapper implements Mapper { @Override public Object keyForSource(RowProxy source) { Map<String, Object> keyMap = new HashMap<>(pathMappers.size() * 2); for (Entry<String, Mapper> e : pathMappers.entrySet()) { keyMap.put(e.getKey(), e.getValue().keyForSource(source)); } return keyMap; } MultiPathMapper(Map<String, Mapper> pathMappers); @Override Expression expressionForKey(Object key); @Override Object keyForSource(RowProxy source); @Override Object keyForTarget(DataObject target);  }
@Test public void testKeyForSource() { Map<String, Object> source = new HashMap<>(); source.put("a", "a1"); source.put("b", 5); source.put("c", 6); Object key = mapper.keyForSource(new TestRowProxy(Index.forLabels("a", "b", "c"), "a1", 5, 6)); assertTrue(key instanceof Map); @SuppressWarnings({ "unchecked", "rawtypes" }) Map<String, Object> keyMap = (Map) key; assertEquals(2, keyMap.size()); assertEquals("a1", keyMap.get("a")); assertEquals(5, keyMap.get("b")); }