for (ProteinLocation location : locations) {
ProteinLocation loc = proteinMap.get(location.getStartIndex());
if (loc == null) {
proteinMap.put(location.getStartIndex(), location);
} else {
loc.update(location);
}
}
ArrayList<ProteinLocation> proteinList = new ArrayList<ProteinLocation>(proteinMap.values());
return proteinList;
}