docs: public static UpdateMonitor getMonitor(File monitoredFile, MonitorType type, String filter) {
  
          if (monitoredFile == null)
              throw new NullPointerException("MonitoredFile must be non-null");
          if (type == null)
              throw new NullPointerException("MonitorType must be non-null");
  
          switch (type) {
              case DIRECTORY:
              case DIRECTORY_RECURSE:
              case DIRECTORY_SELF:
              case DIRECTORY_RECURSE_SELF:
                  return new DirectoryUpdateMonitor(monitoredFile, type, filter);
              case FILE:
                  return new FileUpdateMonitor(monitoredFile);
              default:
                  throw new IllegalArgumentException("Unknown monitor type: " + type);
          }
      }