### Question:
Memory { public boolean areErrorsOccured() { return !this.processingErrors.isEmpty(); } Memory(); Map<String, Object> put(String key, Object value); void increment(); void decrement(); long counterValue(); Object get(String key); void processed(); void errorOccured(); long getProcessedRowCount(); long getErroneousRowCount(); void addProcessingError(Row erroneous, Throwable ex); boolean areErrorsOccured(); Collection<Throwable> getProcessingErrors(); Set<Row> getErroneousRows(); @Override String toString();  }### Answer:
@Test public void areErrorsOccured() { Memory memory = new Memory(); Collection<Throwable> processingErrors = memory.getProcessingErrors(); assertTrue(processingErrors.isEmpty()); assertFalse(memory.areErrorsOccured()); final Row row = new Row(); memory.addProcessingError(row, new Exception("test")); assertTrue(memory.areErrorsOccured()); processingErrors = memory.getProcessingErrors(); assertThat(processingErrors.size(), is(1)); Set<Row> erroneousRows = memory.getErroneousRows(); assertThat(erroneousRows.size(), is(1)); assertTrue(erroneousRows.contains(row)); }