code: function checkOptions(caps, key, optionType, setMethod) {
    let val = caps.get(key);
    if (val instanceof optionType) {
      throw new error.InvalidArgumentError(
          'Options class extends Capabilities and should not be set as key '
              + `"${key}"; set browser-specific options with `
              + `Builder.${setMethod}(). For more information, see the `
              + 'documentation attached to the function that threw this error');
    }
  }
docs: In the 3.x releases, the various browser option classes
  (e.g. firefox.Options) had to be manually set as an option using the
  Capabilties class:
  
  let ffo = new firefox.Options();
  // Configure firefox options...
  
  let caps = new Capabilities();
  caps.set('moz:firefoxOptions', ffo);
  
  let driver = new Builder()
  .withCapabilities(caps)
  .build();
  
  The options are now subclasses of Capabilities and can be used directly. A
  direct translation of the above is:
  
  let ffo = new firefox.Options();
  // Configure firefox options...
  
  let driver = new Builder()
  .withCapabilities(ffo)
  .build();
  
  You can also set the options for various browsers at once and let the builder
  choose the correct set at runtime (see Builder docs above):
  
  let ffo = new firefox.Options();
  // Configure ...
  
  let co = new chrome.Options();
  // Configure ...
  
  let driver = new Builder()
  .setChromeOptions(co)
  .setFirefoxOptions(ffo)
  .build();
  
  @param {!Capabilities} caps
  @param {string} key
  @param {function(new: Capabilities)} optionType
  @param {string} setMethod
  @throws {error.InvalidArgumentError}