EventsUtils { public static DeploymentEvent logToEvent(final LogEntry logEntry, final String hostName, final String hostAddress) { String text = logEntry.getText(); String[] split = text.split(" - "); if (split.length < 2) { throw new IllegalArgumentException("Expected a separator (' - ') in USM log entry: " + text); } String textWithoutLogger = split[1]; String actualEvent = textWithoutLogger.substring(textWithoutLogger.indexOf(".") + 1); DeploymentEvent event = new DeploymentEvent(); event.setDescription("[" + hostName + "/" + hostAddress + "] - " + actualEvent); return event; } 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 testLogToEvent() throws Exception { LogEntry entryMock = Mockito.mock(LogEntry.class); Mockito.when(entryMock.getText()).thenReturn("USMLOGGER" + " - " + MOCK_EVENT); String hostName = "hostname"; String hostAddress = "hostaddress"; String expectedEventString = "[" + hostName + "/" + hostAddress + "] - " + MOCK_EVENT; Assert.assertEquals(expectedEventString, EventsUtils.logToEvent(entryMock, hostName, hostAddress).getDescription()); }