code: public BufferedImage takeScreenshotEntirePage() {
          if (driver instanceof EventFiringWebDriver) {
              driver = ((EventFiringWebDriver) this.driver).getWrappedDriver();
          }
  
          if (driver instanceof ChromeDriver) {
              return takeScreenshotEntirePageUsingChromeCommand();
          } else if (driver instanceof RemoteWebDriver) {
              if (((RemoteWebDriver) driver).getCapabilities().getBrowserName().equals("chrome")) {
                  return takeScreenshotEntirePageUsingChromeCommand();
              }
          }
          return takeScreenshotEntirePageDefault();
      }
docs: Using different screenshot strategy dependently on driver:
  for  chrome - chrome command will be used
  for others - their default screenshot methods
  @return BufferedImage resulting image