ChannelUtils { public static Event take(final Channel channel) throws ChannelException { return transact(channel, new Callable<Event>() { @Override public Event call() { return channel.take(); } }); } private  ChannelUtils(); static void put(final Channel channel, final Event event); static void put(final Channel channel, final Collection<Event> events); static Event take(final Channel channel); static List<Event> take(final Channel channel, final int max); static void transact(Channel channel, Runnable transactor); static T transact(Channel channel, Callable<T> transactor);  }
@Test public void testHappyPath2() { ChannelUtils.take(channel); Assert.assertTrue(channel.wasLastTransactionCommitted()); Assert.assertFalse(channel.wasLastTransactionRolledBack()); Assert.assertTrue(channel.wasLastTransactionClosed()); }