@Override public MatchesType marshal(Set<Match> matches){
  Set<RPSBlastMatch> rpsBlastMatches=new LinkedHashSet<RPSBlastMatch>();
  Set<Hmmer2Match> hmmer2Matches=new LinkedHashSet<Hmmer2Match>();
  Set<Hmmer3Match> hmmer3Matches=new LinkedHashSet<Hmmer3Match>();
  Set<SuperFamilyHmmer3Match> superFamilyHmmer3Matches=new LinkedHashSet<SuperFamilyHmmer3Match>();
  Set<FingerPrintsMatch> fingerPrintsMatches=new LinkedHashSet<FingerPrintsMatch>();
  Set<BlastProDomMatch> proDomMatches=new LinkedHashSet<BlastProDomMatch>();
  Set<PatternScanMatch> patternScanMatches=new LinkedHashSet<PatternScanMatch>();
  Set<ProfileScanMatch> profileScanMatches=new LinkedHashSet<ProfileScanMatch>();
  Set<PhobiusMatch> phobiusMatches=new LinkedHashSet<PhobiusMatch>();
  Set<CoilsMatch> coilsMatches=new LinkedHashSet<CoilsMatch>();
  Set<PantherMatch> pantherMatches=new LinkedHashSet<PantherMatch>();
  Set<SignalPMatch> signalPMatches=new LinkedHashSet<SignalPMatch>();
  Set<TMHMMMatch> tmhmmPMatches=new LinkedHashSet<TMHMMMatch>();
  for (  Match m : matches) {
    if (m instanceof RPSBlastMatch) {
      rpsBlastMatches.add((RPSBlastMatch)m);
    }
 else     if (m instanceof Hmmer2Match) {
      hmmer2Matches.add((Hmmer2Match)m);
    }
 else     if (m instanceof Hmmer3Match) {
      hmmer3Matches.add((Hmmer3Match)m);
    }
 else     if (m instanceof SuperFamilyHmmer3Match) {
      superFamilyHmmer3Matches.add((SuperFamilyHmmer3Match)m);
    }
 else     if (m instanceof FingerPrintsMatch) {
      fingerPrintsMatches.add((FingerPrintsMatch)m);
    }
 else     if (m instanceof BlastProDomMatch) {
      proDomMatches.add((BlastProDomMatch)m);
    }
 else     if (m instanceof PatternScanMatch) {
      patternScanMatches.add((PatternScanMatch)m);
    }
 else     if (m instanceof ProfileScanMatch) {
      profileScanMatches.add((ProfileScanMatch)m);
    }
 else     if (m instanceof PhobiusMatch) {
      phobiusMatches.add((PhobiusMatch)m);
    }
 else     if (m instanceof CoilsMatch) {
      coilsMatches.add((CoilsMatch)m);
    }
 else     if (m instanceof PantherMatch) {
      pantherMatches.add((PantherMatch)m);
    }
 else     if (m instanceof SignalPMatch) {
      signalPMatches.add((SignalPMatch)m);
    }
 else     if (m instanceof TMHMMMatch) {
      tmhmmPMatches.add((TMHMMMatch)m);
    }
 else {
      throw new IllegalArgumentException("Unrecognised Match class: " + m);
    }
  }
  return new MatchesType(rpsBlastMatches,hmmer2Matches,hmmer3Matches,superFamilyHmmer3Matches,fingerPrintsMatches,proDomMatches,patternScanMatches,profileScanMatches,phobiusMatches,coilsMatches,pantherMatches,signalPMatches,tmhmmPMatches);
}

@ Override public MatchesType marshal ( Set < Match > matches ) { Set < RPSBlastMatch > rpsBlastMatches = new LinkedHashSet < RPSBlastMatch > ( ) ; Set < Hmmer2Match > hmmer2Matches = new LinkedHashSet < Hmmer2Match > ( ) ; Set < Hmmer3Match > hmmer3Matches = new LinkedHashSet < Hmmer3Match > ( ) ; Set < SuperFamilyHmmer3Match > superFamilyHmmer3Matches = new LinkedHashSet < SuperFamilyHmmer3Match > ( ) ; Set < FingerPrintsMatch > fingerPrintsMatches = new LinkedHashSet < FingerPrintsMatch > ( ) ; Set < BlastProDomMatch > proDomMatches = new LinkedHashSet < BlastProDomMatch > ( ) ; Set < PatternScanMatch > patternScanMatches = new LinkedHashSet < PatternScanMatch > ( ) ; Set < ProfileScanMatch > profileScanMatches = new LinkedHashSet < ProfileScanMatch > ( ) ; Set < PhobiusMatch > phobiusMatches = new LinkedHashSet < PhobiusMatch > ( ) ; Set < CoilsMatch > coilsMatches = new LinkedHashSet < CoilsMatch > ( ) ; Set < PantherMatch > pantherMatches = new LinkedHashSet < PantherMatch > ( ) ; Set < SignalPMatch > signalPMatches = new LinkedHashSet < SignalPMatch > ( ) ; Set < TMHMMMatch > tmhmmPMatches = new LinkedHashSet < TMHMMMatch > ( ) ; for ( Match m : matches ) { if ( m instanceof RPSBlastMatch ) { rpsBlastMatches . add ( ( RPSBlastMatch ) m ) ; } else if ( m instanceof Hmmer2Match ) { hmmer2Matches . add ( ( Hmmer2Match ) m ) ; } else if ( m instanceof Hmmer3Match ) { hmmer3Matches . add ( ( Hmmer3Match ) m ) ; } else if ( m instanceof SuperFamilyHmmer3Match ) { superFamilyHmmer3Matches . add ( ( SuperFamilyHmmer3Match ) m ) ; } else if ( m instanceof FingerPrintsMatch ) { fingerPrintsMatches . add ( ( FingerPrintsMatch ) m ) ; } else if ( m instanceof BlastProDomMatch ) { proDomMatches . add ( ( BlastProDomMatch ) m ) ; } else if ( m instanceof PatternScanMatch ) { patternScanMatches . add ( ( PatternScanMatch ) m ) ; } else if ( m instanceof ProfileScanMatch ) { profileScanMatches . add ( ( ProfileScanMatch ) m ) ; } else if ( m instanceof PhobiusMatch ) { phobiusMatches . add ( ( PhobiusMatch ) m ) ; } else if ( m instanceof CoilsMatch ) { coilsMatches . add ( ( CoilsMatch ) m ) ; } else if ( m instanceof PantherMatch ) { pantherMatches . add ( ( PantherMatch ) m ) ; } else if ( m instanceof SignalPMatch ) { signalPMatches . add ( ( SignalPMatch ) m ) ; } else if ( m instanceof TMHMMMatch ) { tmhmmPMatches . add ( ( TMHMMMatch ) m ) ; } else { throw new IllegalArgumentException ( "Unrecognised Match class: " + m ) ; } } return new MatchesType ( rpsBlastMatches , hmmer2Matches , hmmer3Matches , superFamilyHmmer3Matches , fingerPrintsMatches , proDomMatches , patternScanMatches , profileScanMatches , phobiusMatches , coilsMatches , pantherMatches , signalPMatches , tmhmmPMatches ) ; }
map java to xml type
