BiojavaPairwiseAlignment extends AbstractPairwiseAlignment implements Serializable { private void readObject(final ObjectInputStream in) throws InvalidObjectException { throw new InvalidObjectException("proxy required for serialization"); } private  BiojavaPairwiseAlignment(final SubstitutionMatrix substitutionMatrix); @Override Iterable<AlignmentPair> local(final List<Sequence> queries,
                                         final List<Sequence> subjects,
                                         final GapPenalties gapPenalties); @Override Iterable<AlignmentPair> global(final List<Sequence> queries,
                                          final List<Sequence> subjects,
                                          final GapPenalties gapPenalties); static PairwiseAlignment create(); static PairwiseAlignment create(final SubstitutionMatrix substitutionMatrix);  }
@Test public void testSerialization() throws Exception { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(buffer); out.writeObject(align); out.close(); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())); Object dest = in.readObject(); in.close(); assertTrue(dest instanceof BiojavaPairwiseAlignment); assertNotNull(((BiojavaPairwiseAlignment) dest).getSubstitutionMatrix()); }