code: public static void writeSequences(OutputStream outputStream,
  			Collection<Sequence<?>> sequences) throws Exception {
  
  		FastaHeaderFormatInterface<Sequence<?>, Compound> fhfi =
  				new FastaHeaderFormatInterface<Sequence<?>, Compound>() {
  
  					@Override
  					public String getHeader(Sequence<?> sequence) {
  						return sequence.getAccession().toString();
  					}
  
  					;
  				};
  
  		FastaWriter<Sequence<?>, Compound> fastaWriter =
  				new FastaWriter<Sequence<?>, Compound>(outputStream,
  				sequences, fhfi);
  
  		fastaWriter.process();
  	}
docs: Method which will write your given Sequences to the specified
  {@link OutputStream}. This is a very generic method which writes just the
  AccessionID of the Sequence as the FASTA header.
  
  @param outputStream Stream to write to; can be System.out
  @param sequences The sequences to write out
  @throws Exception Thrown normally thanks to IO problems