public String expandTemplates(EnumWikipedia wikipedia, String title, String text) throws APIException {
if (text == null) {
return null;
}
final API api = APIFactory.getAPI();
addTask(new ExpandTemplatesCallable(wikipedia, this, api, title, text));
while (hasRemainingTask() && !shouldStop()) {
Object result = getNextResult();
if (result != null) {
return result.toString();
}