WearUtil { public static void threadSleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { } }  static String dateTimeText(long timeInMs); static long timestamp(); static long msSince(long when); static long msTill(long when); static synchronized boolean isBelowRateLimit(String named, int onceForSeconds); static PowerManager.WakeLock getWakeLock(final String name, int millis); static void releaseWakeLock(PowerManager.WakeLock wl); static void startActivity(Class c); static Intent getStartActivityIntent(Class c); static void threadSleep(long millis); static String joinSet(Set<String> set, String separator); static Set<String> explodeSet(String joined, String separator); static DataMap bundleToDataMap(Bundle bundle);  }
@Test public void threadSleepTest() { final long testStart = System.currentTimeMillis(); final long requestedSleepDuration = 85L; final long measuringMargin = 100L; WearUtil.threadSleep(requestedSleepDuration); final long measuredSleepDuration = System.currentTimeMillis() - testStart; assertThat(measuredSleepDuration, is(both(greaterThan(60L)).and(lessThan(requestedSleepDuration+measuringMargin)))); }