EventsUtils { public static DeploymentEvents extractDesiredEvents(final DeploymentEvents events, final int from, final int to) { DeploymentEvents desiredEvents = new DeploymentEvents(); for (int i = from; i <= to; i++) { List<DeploymentEvent> serviceDeploymentEvents = events.getEvents(); DeploymentEvent serviceDeploymentEvent = retrieveEventWithIndex(i, serviceDeploymentEvents); if (serviceDeploymentEvent != null) { desiredEvents.getEvents().add(serviceDeploymentEvent); } } return desiredEvents; } private  EventsUtils(); static DeploymentEvent logToEvent(final LogEntry logEntry,
			final String hostName,
			final String hostAddress); static LogEntryMatcher createUSMEventLoggerMatcher(); static DeploymentEvents extractDesiredEvents(final DeploymentEvents events,
			final int from,
			final int to); static DeploymentEvent retrieveEventWithIndex(final int i,
			final List<DeploymentEvent> serviceDeploymentEvents); static boolean eventsPresent(final DeploymentEvents events,
			final int from,
			final int to); static String getThreadId();  }
@Test public void testExtractDesiredEvents() throws Exception { DeploymentEvents events = createEvents(0, 10); Assert.assertEquals(createEvents(0, 4).getEvents(), EventsUtils.extractDesiredEvents(events, 0, 4).getEvents()); Assert.assertEquals(createEvents(0, 10).getEvents(), EventsUtils.extractDesiredEvents(events, 0, 10).getEvents()); Assert.assertEquals(createEvents(0, -1).getEvents(), EventsUtils.extractDesiredEvents(events, 11, 15).getEvents()); Assert.assertEquals(createEvents(0, 10).getEvents(), EventsUtils.extractDesiredEvents(events, 0, 100).getEvents()); Assert.assertEquals(createEvents(0, 0).getEvents(), EventsUtils.extractDesiredEvents(events, 0, 0).getEvents()); }