FIXMessageDecoder implements MessageDecoder { public List<String> extractMessages(File file) throws IOException, ProtocolCodecException { final List<String> messages = new ArrayList<>(); extractMessages(file, messages::add); return messages; } FIXMessageDecoder();  FIXMessageDecoder(String charset);  FIXMessageDecoder(String charset, String delimiter); @Override MessageDecoderResult decodable(IoSession session, IoBuffer in); @Override MessageDecoderResult decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out); @Override void finishDecode(IoSession session, ProtocolDecoderOutput out); List<String> extractMessages(File file); void extractMessages(File file, final MessageListener listener);  }
@Test public void testMessageExtraction() throws Exception { File testFile = setUpTestFile(); FIXMessageDecoder decoder = new FIXMessageDecoder(); List<String> messages = decoder.extractMessages(testFile); assertCorrectlyExtractedMessages(messages); }
@Test public void testMessageStreamingExtraction() throws Exception { File testFile = setUpTestFile(); FIXMessageDecoder decoder = new FIXMessageDecoder(); final List<String> messages = new ArrayList<>(); decoder.extractMessages(testFile, messages::add); assertCorrectlyExtractedMessages(messages); }