code: private static Boolean checkMethod(NetworkInterface iface, Method toCheck) {
          if (toCheck != null) {
              try {
                  return (Boolean) toCheck.invoke(iface, (Object[]) null);
              } catch (IllegalAccessException e) {
                  return false;
              } catch (InvocationTargetException e) {
                  return false;
              }
          }
          // Cannot check, hence we assume that is true
          return true;
      }
docs: Call a method and return the result as boolean. In case of problems, return false.