private static ConfigList expandSugarArray(ConfigValue fieldValue,
Class<?> elementType,
PluginRegistry pluginRegistry,
boolean nested) {
ConfigList fieldList = (ConfigList) fieldValue;
List<Object> newList = new ArrayList<>(fieldList.size());
for (ConfigValue listEntry : fieldList) {
ConfigValue listObject;
if (nested) {
listObject = expandSugarArray(listEntry, elementType, pluginRegistry, false);
} else {
listObject = expandSugar(elementType, listEntry, pluginRegistry);
}
newList.add(listObject.unwrapped());
}
return ConfigValueFactory.fromIterable(newList, fieldList.origin().description());
}