BeanAdapter extends AbstractMap<String, Object> { @SuppressWarnings("unchecked") public static <V> V valueAt(Object root, String path) { Object value = root; String[] components = path.split("\\."); for (int i = 0; i < components.length; i++) { if (value == null) { break; } String component = components[i]; if (!(value instanceof Map<?, ?>)) { value = new BeanAdapter(value); } value = ((Map<?, ?>)value).get(component); } return (V)value; } BeanAdapter(Object bean); private  BeanAdapter(Object bean, HashMap<Class<?>, HashMap<String, Method>> accessorCache); @Override Object get(Object key); @Override Set<Entry<String, Object>> entrySet(); @SuppressWarnings("unchecked") static T adapt(Object value); @SuppressWarnings("unchecked") static T adapt(Object value, Type type); static List<E> adaptList(List<?> list, Type elementType); static Map<K, V> adaptMap(Map<K, ?> map, Type valueType); @SuppressWarnings("unchecked") static V valueAt(Object root, String path); static String describe(Type type, Map<Class<?>, String> structures);  }
@Test public void testValueAt() { Map<String, ?> map = mapOf( entry("a", mapOf( entry("b", mapOf( entry("c", 123) )) )) ); assertEquals(Integer.valueOf(123), BeanAdapter.valueAt(map, "a.b.c")); }