LightCycles { public static <Source, Target extends Source> ActivityLightCycle<Target> lift(final ActivityLightCycle<Source> lightCycle) { return new LiftedActivityLightCycle<>(lightCycle); }  @SuppressWarnings("PMD.EmptyCatchBlock") static void bind(LightCycleDispatcher<?> target); static void enableDebugLogging(boolean enabled); static ActivityLightCycle<Target> lift(final ActivityLightCycle<Source> lightCycle); @TargetApi(Build.VERSION_CODES.HONEYCOMB) static FragmentLightCycle<Target> lift(final FragmentLightCycle<Source> lightCycle); static SupportFragmentLightCycle<Target> lift(final SupportFragmentLightCycle<Source> lightCycle);  }
@Test public void liftedActivityLightCycleAreEqualsWhenTheSourceIsTheSame() { final DefaultActivityLightCycle<Activity> lightCycle = new DefaultActivityLightCycle<>(); final ActivityLightCycle<Activity> lift1 = LightCycles.lift(lightCycle); final ActivityLightCycle<Activity> lift2 = LightCycles.lift(lightCycle); assertThat(lift1, not(sameInstance(lift2))); assertThat(lift1, equalTo(lift2)); }
@Test public void liftedFragmentLightCycleAreEqualsWhenTheSourceIsTheSame() { final DefaultFragmentLightCycle<Fragment> lightCycle = new DefaultFragmentLightCycle<>(); final FragmentLightCycle<Fragment> lift1 = LightCycles.lift(lightCycle); final FragmentLightCycle<Fragment> lift2 = LightCycles.lift(lightCycle); assertThat(lift1, not(sameInstance(lift2))); assertThat(lift1, equalTo(lift2)); }
@Test public void liftedSupportFragmentLightCycleAreEqualsWhenTheSourceIsTheSame() { final DefaultSupportFragmentLightCycle<Fragment> lightCycle = new DefaultSupportFragmentLightCycle<>(); final SupportFragmentLightCycle<Fragment> lift1 = LightCycles.lift(lightCycle); final SupportFragmentLightCycle<Fragment> lift2 = LightCycles.lift(lightCycle); assertThat(lift1, not(sameInstance(lift2))); assertThat(lift1, equalTo(lift2)); }