throws TeamException {
final Map<URIish, Map<String, Set<ProjectReference>>> repositories = new LinkedHashMap<URIish, Map<String, Set<ProjectReference>>>();
for (final String reference : referenceStrings) {
try {
final ProjectReference projectReference = new ProjectReference(
reference);
Map<String, Set<ProjectReference>> repositoryBranches = repositories
.get(projectReference.getRepository());
if (repositoryBranches == null) {
repositoryBranches = new HashMap<String, Set<ProjectReference>>();
repositories.put(projectReference.getRepository(),
repositoryBranches);
}
Set<ProjectReference> projectReferences = repositoryBranches
.get(projectReference.getBranch());
if (projectReferences == null) {
projectReferences = new LinkedHashSet<ProjectReference>();
repositoryBranches.put(projectReference.getBranch(),
projectReferences);
}
projectReferences.add(projectReference);
} catch (final IllegalArgumentException e) {