### Question:
Util { public static Object getObjectProperty(Object obj, String propertyName, boolean failSilently) { try { return getObjectProperty(obj, propertyName); } catch (Exception e) { String msg = "failed to get property '" + propertyName + "' of object " + obj; if (failSilently) { logger.info(msg, e); return null; } else { logger.warn(msg); throw new IllegalArgumentException(e); } } }  static List<String> getFormulaCellRefs(String formula); static List<String> getJointedCellRefs(String formula); static List<String> getCellRefsFromJointedCellRef(String jointedCellRef); static boolean formulaContainsJointedCellRef(String formula); static String createTargetCellRef(List<CellRef> targetCellDataList); static String joinStrings(List<String> strings, String separator); static List<List<CellRef>> groupByRanges(List<CellRef> cellRefList, int targetRangeCount); static List<List<CellRef>> groupByColRange(List<CellRef> cellRefList); static List<List<CellRef>> groupByRowRange(List<CellRef> cellRefList); static Boolean isConditionTrue(ExpressionEvaluator evaluator, String condition, Context context); static Boolean isConditionTrue(ExpressionEvaluator evaluator, Context context); static void setObjectProperty(Object obj, String propertyName, String propertyValue, boolean ignoreNonExisting); static void setObjectProperty(Object obj, String propertyName, String propertyValue); static Object getObjectProperty(Object obj, String propertyName, boolean failSilently); static Object getObjectProperty(Object obj, String propertyName); static Collection<GroupData> groupCollection(Collection<?> collection, String groupProperty, String groupOrder); static Collection<GroupData> groupIterable(Iterable<?> iterable, String groupProperty, String groupOrder); static byte[] toByteArray(InputStream stream); static Collection<?> transformToCollectionObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context); static String sheetNameRegex(Map.Entry<CellRef, List<CellRef>> cellRefEntry); static List<CellRef> createTargetCellRefListByColumn(CellRef targetFormulaCellRef, List<CellRef> targetCells,
            List<CellRef> cellRefsToExclude); static int countOccurences(String str, char ch); static Iterable<Object> transformToIterableObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context); static String getStrictCellNameRegex(String name); static final String regexJointedLookBehind; static final String regexSimpleCellRef; static final String regexCellRef; static final String regexAreaRef; static final Pattern regexAreaRefPattern; static final String regexCellRefExcludingJointed; static final String regexJointedCellRef; static final String regexExcludePrefixSymbols; }### Answer:
@Test public void getObjectProperty_Map() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Map<String, String> map = new HashMap<>(); map.put("foo", "bar"); String r = (String) Util.getObjectProperty(map, "foo"); assertEquals("bar", r); }
@Test public void getObjectProperty_DynaBean() throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { DynaClass dynaClass = new BasicDynaClass("Employee", null, new DynaProperty[] { new DynaProperty("name", String.class), }); DynaBean bond = dynaClass.newInstance(); bond.set("name", "James Bond 007"); String r = (String) Util.getObjectProperty(bond, "name"); assertEquals("James Bond 007", r); }
@Test public void getObjectProperty_JavaBean() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Person bond = new Person("James Bond", 42, "London"); bond.setDummy(new Dummy("007")); String name = (String) Util.getObjectProperty(bond, "name"); String number = (String) Util.getObjectProperty(bond, "dummy.strValue"); assertEquals("James Bond", name); assertEquals("007", number); }