### Question:
StopWatch { @Override public String toString() { return formatMillis(getMillis()); } StopWatch();  StopWatch(Date theStart);  StopWatch(long theStart); void endCurrentTask(); String formatMillisPerOperation(long theNumOperations); String formatTaskDurations(); String formatThroughput(long theNumOperations, TimeUnit theUnit); String getEstimatedTimeRemaining(double theCompleteToDate, double theTotal); long getMillis(Date theNow); long getMillis(); long getMillisAndRestart(); long getMillisPerOperation(long theNumOperations); Date getStartedDate(); double getThroughput(long theNumOperations, TimeUnit theUnit); void restart(); void startTask(String theTaskName); @Override String toString(); static String formatMillis(long theMillis); static String formatMillis(double theMillis);  }### Answer:
@Test public void testToString() throws Exception { StopWatch sw = new StopWatch(); Thread.sleep(100); String string = sw.toString(); ourLog.info(string); assertThat(string, matchesPattern("^[0-9]{3,4}ms$")); }