Landscape extends BaseEntity { public void createNewException(final String id, final String cause) { long currentMillis = java.lang.System.currentTimeMillis(); final List<Long> timestampsOfExceptionEvents = this.getEvents().stream().filter(e -> e.getEventType().equals(EEventType.EXCEPTION)) .map(Event::getTimestamp).collect(Collectors.toList()); while (timestampsOfExceptionEvents.contains(currentMillis)) { currentMillis++; } this.getEvents().add(new Event(id, currentMillis, EEventType.EXCEPTION, cause)); } @JsonCreator  Landscape(@JsonProperty("id") final String id,
      @JsonProperty("timestamps") final Timestamp timestamp); Timestamp getTimestamp(); void setTimestamp(final Timestamp timestamp); List<System> getSystems(); List<Event> getEvents(); List<ApplicationCommunication> getTotalApplicationCommunications(); void setTotalApplicationCommunications(
      final List<ApplicationCommunication> totalApplicationCommunications); void reset(); void createNewException(final String id, final String cause); void createNewEvent(final String id, final EEventType eventType,
      final String eventMesssage); void createOutgoingApplicationCommunication();  }
@Test public void testCreateNewException() { final long currentMillis = java.lang.System.currentTimeMillis(); final String expectedCause = "Exception thrown in application 'sampleApplication' by class 'boolean java.sql.Statement.execute(String)':\\n ..."; final Event expectedEvent = new Event("4", currentMillis, EEventType.EXCEPTION, expectedCause); this.l.createNewException("4", expectedCause); final Event actualEvent = this.l.getEvents().get(0); assertEquals(expectedEvent.getEventType(), actualEvent.getEventType()); assertEquals(expectedEvent.getEventMessage(), actualEvent.getEventMessage()); }