code: private String getVersionWithReflection(Class<?> dummy) {
          Method meth = null;
          try {
              Method[] declaredMethods = dummy.getDeclaredMethods();
              if (declaredMethods.length == 0) {
                  return null;
              }
  
              for (Method method : declaredMethods) {
                  if (method.getName().equals("getVersion")) {
                      meth = method;
                      break;
                  }
              }
  
              if (meth != null) {
                  try {
                      meth.setAccessible(true);
                      if (Modifier.isStatic(meth.getModifiers())) {
  
                          Object value = meth.invoke(null);
                          if (value instanceof String) {
                              return (String) value;
                          }
                      }
                      return null;
                  } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
                      logger.trace("Unable to call getVersion on " + dummy.getName());
                  }
              }
          } catch (SecurityException _ex) {
              return null;
          }
  
          return null;
      }
docs: Helper which tries to find (and call) the method 'getVersion()' using reflection.
  
  @param dummy whatever
  @return value of getVersion() or null