final SortedSet<IlluminaDataType> toSupport = new TreeSet<IlluminaDataType>(requestedDataTypes);
final Map<SupportedIlluminaFormat, Set<IlluminaDataType>> fileTypeToDataTypes = new HashMap<SupportedIlluminaFormat, Set<IlluminaDataType>>();
final Map<IlluminaDataType, SupportedIlluminaFormat> dataTypeToFormat = new HashMap<IlluminaDataType, SupportedIlluminaFormat>();
for (final IlluminaDataType ts : toSupport) {
final SupportedIlluminaFormat preferredFormat = findPreferredAvailableFormat(ts, fileUtil);
if (preferredFormat != null) {
dataTypeToFormat.put(ts, preferredFormat);
}
}
for (final IlluminaDataType dt : toSupport) {
final SupportedIlluminaFormat format = dataTypeToFormat.get(dt);
if (format != null) {
if (fileTypeToDataTypes.containsKey(format)) {
fileTypeToDataTypes.get(format).add(dt);
} else {