code: private ResultFactory guessFactory(File f){
  		if (extensionFactoryAssociation == null){
  			extensionFactoryAssociation = new HashMap<String, ResultFactory>();
  			ServiceLoader<ResultFactory> impl = ServiceLoader.load(ResultFactory.class);
  			for (ResultFactory loadedImpl : impl) {
  				List<String> fileExtensions = loadedImpl.getFileExtensions();
  				for (String ext: fileExtensions) extensionFactoryAssociation.put(ext, loadedImpl);
  			}
  		}
  
  		String filename = f.getAbsolutePath();
  		int extensionPos = filename.lastIndexOf(".");
  		String extension = filename.substring(extensionPos + 1);
  		if (extensionFactoryAssociation.get(extension) == null)
  			throw new UnsupportedOperationException(NOT_SUPPORTED_FILE_EXCEPTION
  					+ "\nExtension:"+ extension);
  
  		return extensionFactoryAssociation.get(extension);
  	}
  
  	public double getEvalueThreshold() {
  		return evalueThreshold;
  	}
  
  	@Override
  	public Iterator<Result> iterator() {
  		return new Iterator<Result>() {
  			int currentResult = 0;
  			@Override
  			public boolean hasNext() {
  				return currentResult < results.size();
  			}
  
  			@Override
  			public Result next() {
  				if(!hasNext()){
  					throw new NoSuchElementException();
  				}
  				return results.get(currentResult++);
  			}
  
  			@Override
  			public void remove() {
  				throw new UnsupportedOperationException("The remove operation is not supported by this iterator");
  			}
  		};
  	}
  }
docs: Guess factory class to be used using file extension.
  It can be used both for read and for in write.
  To be ResultFactory classes automatically available to this subsystem
  they must be listed in the file org.biojava.nbio.core.search.io.ResultFactory
  located in src/main/resources
  
  @param f: file. Its last extension (text after last dot) will be compared
  to default extensions of known ResultFactory implementing classes
  @return the guessed factory