if ((aliases == null) || aliases.isEmpty()) return Collections.emptyMap();
if (aliases.size() == 1)
{
Alias alias = aliases.get(0);
return Collections.singletonMap(alias.getName(), alias.getTarget());
}
Map<String, String> map = new HashMap<String, String>();
for (Alias alias: aliases)
{
map.put(alias.getName(), alias.getTarget());
}
return map;
}