boolean () { Object instance = getInstance(); try { return (boolean)MethodHandles.publicLookup() .findVirtual(instance.getClass(), myGetterName, MethodType.methodType(boolean.class)) .invoke(instance); } catch (Throwable exception) { LOG.error(String.format("Boolean getter '%s' not found in %s", myGetterName, instance), exception); } return false; }