Well, I implemented like this and it worked:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.*;
import org.openqa.selenium.JavascriptExecutor;
var wait = new WebDriverWait(WDS.browser, 1000);
ExpectedCondition jQueryLoad = new ExpectedCondition() { public Boolean apply (WebDriver driver) {
return WDS.browser.executeScript("return jQuery.active", new Object[] {} ) == 0;
} wait.until(jQueryLoad);