### Question:
BeanMapper extends AbstractMapper<Object> { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public Map<Path<?>, Object> createMap(RelationalPath<?> entity, Object bean) { Map<Path<?>, Object> values = Maps.newLinkedHashMap(); Map<String, Object> map = new BeanMap(bean); Map<String, Path<?>> columns = getColumns(entity); for (Map.Entry<String, Path<?>> entry : columns.entrySet()) { Path<?> path = entry.getValue(); if (map.containsKey(entry.getKey())) { Object value = map.get(entry.getKey()); if (value != null) { values.put(path, value); } else if (withNullBindings && !isPrimaryKeyColumn(entity, path)) { values.put(path, Null.DEFAULT); } } } return values; } BeanMapper();  BeanMapper(boolean withNullBindings); @SuppressWarnings({ "rawtypes", "unchecked" }) @Override Map<Path<?>, Object> createMap(RelationalPath<?> entity, Object bean); static final BeanMapper DEFAULT; static final BeanMapper WITH_NULL_BINDINGS; }### Answer:
@Test public void extract() { Map<Path<?>, Object> values = BeanMapper.DEFAULT.createMap(emp, employee); assertEquals(employee.getDatefield(), values.get(emp.datefield)); assertEquals(employee.getFirstname(), values.get(emp.firstname)); assertEquals(employee.getLastname(), values.get(emp.lastname)); assertEquals(employee.getSalary(), values.get(emp.salary)); assertEquals(employee.getSuperiorId(), values.get(emp.superiorId)); assertEquals(employee.getTimefield(), values.get(emp.timefield)); }
@Test public void extract2() { Map<Path<?>, Object> values = BeanMapper.DEFAULT.createMap(emp, new EmployeeX()); assertTrue(values.isEmpty()); }