Hey Inaya, you are facing this problem because ChromeDriver(Capabilities capabilities) is deprecated now and thus you cannot directly pass capabilities to ChromeDriver constructor. Now if you still want to pass any capabilities, you can use DesiredCapabilities and then merge within ChromeOptions like below:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("demo_capability", true);
ChromeOptions options = new ChromeOptions();
options.addArguments("disable-infobars");
options.merge(capabilities); //this will merge the capabilities to the ChromeOptions
ChromeDriver driver = new ChromeDriver(options);