RxInputChannel { public static <T> ConnectableObservable<T> wrap(final InputChannel<T> i) { return Observable.<T>create(s -> connect(i, s)).publish(); }  static ConnectableObservable<T> wrap(final InputChannel<T> i);  }
@SuppressWarnings("unchecked") @Test public void test() { final InputChannel<Integer> mockInputChannel = mock(InputChannel.class); when(mockInputChannel.recv()).thenReturn( Futures.immediateFuture(1), Futures.immediateFuture(2), Futures.immediateFailedFuture(PowerMockito.mock(EndOfFileException.class))); assertEquals(ImmutableList.of(1, 2), RxTestCase.first( RxInputChannel.wrap(mockInputChannel).autoConnect().toList())); }