code: private static Object invokeGetter(Object obj, String methodName, Object defaultValue) {
          try {
              Method method = obj.getClass().getMethod(methodName, new Class[0]);
              Object result = method.invoke(obj, new Object[0]);
              return result;
          } catch (NoSuchMethodException e) {
              return defaultValue;
          } catch (IllegalAccessException e) {
              return defaultValue;
          } catch (InvocationTargetException e) {
              return defaultValue;
          }
      }
docs: Invokes the specified getter method if it exists.
  
  @param obj
  The object on which to invoke the method.
  @param methodName
  The name of the method.
  @param defaultValue
  This value is returned, if the method does not exist.
  @return The value returned by the getter method or the default value.