TxtExportAlgorithm { public static @Nonnull String spectrumToString(@Nonnull MsSpectrum spectrum) { return spectrumToString(spectrum, " "); }  static void exportSpectrum(@Nonnull File exportFile, @Nonnull MsSpectrum spectrum); static void exportSpectra(@Nonnull File exportFile,
      @Nonnull Collection<MsSpectrum> spectra); static void exportSpectra(@Nonnull File exportFile,
      @Nonnull Collection<MsSpectrum> spectra, @Nonnull String delimiter); static void spectrumToWriter(@Nonnull MsSpectrum spectrum, @Nonnull Writer writer); static void spectrumToWriter(@Nonnull MsSpectrum spectrum, @Nonnull Writer writer,
      @Nonnull String delimiter); static @Nonnull String spectrumToString(@Nonnull MsSpectrum spectrum); static @Nonnull String spectrumToString(@Nonnull MsSpectrum spectrum,
      @Nonnull String delimiter);  }
@Test public void testSpectrumToString() { MsSpectrum spectrum = mockSpectrum(mzValues1, intensityValues1); String result = TxtExportAlgorithm.spectrumToString(spectrum); String lines[] = result.split("\\r?\\n"); assertThat(lines, arrayContaining(expectedSimple)); }
@Test public void testSpectrumToStringWithTabs() { MsSpectrum spectrum = mockSpectrum(mzValues1, intensityValues1); String result = TxtExportAlgorithm.spectrumToString(spectrum, "\t"); String lines[] = result.split("\\r?\\n"); assertThat(lines, arrayContaining(expectedSimpleWithTabs)); }