TransitionUtils { public static boolean isViewAttachedToWindow(@NonNull final View view) { return view.getWindowToken() != null; } private  TransitionUtils(); static boolean isViewAttachedToWindow(@NonNull final View view);  }
@Test public void testIsViewAttachedToWindow() { assertThat(TransitionUtils.isViewAttachedToWindow(createMockViewAttachedToWindow(true)), is(true)); assertThat(TransitionUtils.isViewAttachedToWindow(createMockViewAttachedToWindow(false)), is(false)); }