public static String[] getDefaultSubsystem(String preferred, List<SubsystemRecord> existing)
{
if(existing.isEmpty())
throw new RuntimeException("No subsystem provided!");
SubsystemRecord chosen = null;
for(SubsystemRecord subsys : existing)
{
if(subsys.getKey().equals(preferred))
{
chosen = subsys;
break;
}
}
if(null==chosen)
chosen = firstAvailable(existing);
return resolveTokens(chosen.getKey());
}