### Question:
ElementNumberProcessMessage implements ProcessMessage { @Override public void processMessage(Row row) { boolean isWindowReady = false; ArrayList<Row> copyNotSyncrhonizedList = null; synchronized (rowTemporalStore) { rowTemporalStore.add(row); isWindowReady = (rowTemporalStore.size() == windowLength); if (isWindowReady) { copyNotSyncrhonizedList = new ArrayList<>(rowTemporalStore); rowTemporalStore.clear(); } } if (isWindowReady) { resultsetCreator.create(copyNotSyncrhonizedList).send(); } } ElementNumberProcessMessage(ConnectorQueryData queryData, ResultsetCreator resultsetCreator); @Override void processMessage(Row row); @Override void end();  }### Answer:
@Test public void processMessageTest() throws Exception { for (int i = 0; i < ITERATIONS; i++) { Row row = mock(Row.class); elementNumberProcessMessage.processMessage(row); } verify(resultSetCreator, times(ITERATIONS / NUM_ROWS)).send(); }