@Test
public void testGetValues() {

    ReplayProcessor<Object> rs = ReplayProcessor.create();
    Object[] expected = new Object[10];
    for (int i = 0; i < expected.length; i++) {
        expected[i] = i;
        rs.onNext(i);
        assertArrayEquals(Arrays.copyOf(expected, i + 1), rs.getValues());
    }
    rs.onComplete();
    assertArrayEquals(expected, rs.getValues());
}