ListTransaction { public static <T, E extends Throwable> OutgoingTransaction<List<T>, E> send(List<T> data) { return new OutgoingTransaction<>(data, data.size(), List::subList); }  static OutgoingTransaction<List<T>, E> send(List<T> data); static IncomingTransaction<List<T>> receive(TransactionToken token);  }
@Test public void testTransactionSuccessful_noData() { List<String> data = Collections.emptyList(); outgoingTransaction = ListTransaction.send(data); assertCorrectTransmission(data); }
@Test public void testTransactionSuccessful_smallData() { List<String> data = Collections.unmodifiableList(Arrays.asList("Orange", "Apple", "Pear")); outgoingTransaction = ListTransaction.send(data); assertCorrectTransmission(data); }
@Test public void testTransactionSuccessful_oneChunk() { List<String> data = generateLongList(ChunkHeader.MAX_ENTRIES); outgoingTransaction = ListTransaction.send(data); assertCorrectTransmission(data); }
@Test public void testTransactionSuccessful_oneAndAHalfChunks() { List<String> data = generateLongList(ChunkHeader.MAX_ENTRIES * 3 / 2); outgoingTransaction = ListTransaction.send(data); assertCorrectTransmission(data); }
@Test public void testTransactionSuccessful_manyChunks() { List<String> data = generateLongList(ChunkHeader.MAX_ENTRIES * 12); outgoingTransaction = ListTransaction.send(data); assertCorrectTransmission(data); }