@Test public void shouldReadFirstObservation() { final ErrorConsumer consumer = mock(ErrorConsumer.class); final long timestamp = 7; final RuntimeException error = new RuntimeException("Test Error"); when(clock.time()).thenReturn(timestamp); log.record(error); assertThat(ErrorLogReader.read(buffer, consumer), is(1)); verify(consumer).accept(eq(1), eq(timestamp), eq(timestamp), any(String.class)); }
public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); } }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }  }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }  static boolean hasErrors(final AtomicBuffer buffer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer, final long sinceTimestamp); }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }  static boolean hasErrors(final AtomicBuffer buffer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer, final long sinceTimestamp);  }