### Question:
ReflectionHelper { public static Object getMappedValue(Object value, Object key) { if ( value == null || !( value instanceof Map ) ) { return null; } Map<?, ?> map = ( Map<?, ?> ) value; return map.get( key ); } private  ReflectionHelper(); static String getPropertyName(Member member); static Class<?> getType(Member member); static Class<?> getAnnotations(Member member); static Type typeOf(Member member); static Object getValue(Member member, Object object); static Type getIndexedType(Type type); static boolean isIterable(Type type); static boolean isMap(Type type); static boolean isList(Type type); static Object getIndexedValue(Object value, Integer index); static Object getMappedValue(Object value, Object key); static Class<?> boxedTyp(Type primitiveType);  }### Answer:
@Test public void testGetIndexedValueForMap() { Map<String, Object> map = new HashMap<String, Object>(); Object testObject = new Object(); String key = "key"; map.put( key, testObject ); Object value = ReflectionHelper.getMappedValue( map, key ); assertEquals( value, testObject, "We should be able to retrieve the indexed object" ); value = ReflectionHelper.getMappedValue( map, "foo" ); assertNull( value, "A non existent index should return the null value" ); value = ReflectionHelper.getMappedValue( map, "2" ); assertNull( value, "A non existent index should return the null value" ); }