WearUtil { public static DataMap bundleToDataMap(Bundle bundle) { return DataMap.fromBundle(bundle); }  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 bundleToDataMapTest() throws Exception { DataMap refMap = new DataMap(); refMap.putString("ala", "ma kota"); refMap.putInt("why", 42); refMap.putFloatArray("list", new float[]{0.45f, 3.2f, 6.8f}); WearUtilMocker.prepareMockNoReal(); Bundle bundle = BundleMock.mock(refMap); DataMap gotMap = WearUtil.bundleToDataMap(bundle); assertThat(gotMap, is(refMap)); }