GroupLifecycleManager { public static GroupLifecycleManager onCreate(ObservableManager observableManager, @Nullable Bundle savedState, @Nullable Object target) { ObservableGroup group; if (savedState != null) { State state = savedState.getParcelable(KEY_STATE); Preconditions.checkState(state != null, "Must call onSaveInstanceState() first"); if (state.managerId != observableManager.id()) { group = observableManager.newGroup(); } else { group = observableManager.getGroup(state.groupId); } } else { group = observableManager.newGroup(); } group.lock(); GroupLifecycleManager manager = new GroupLifecycleManager(observableManager, group); if (target != null) { manager.initializeAutoTaggingAndResubscription(target); } return manager; } private  GroupLifecycleManager(ObservableManager observableManager, ObservableGroup group); static GroupLifecycleManager onCreate(ObservableManager observableManager,
      @Nullable Bundle savedState, @Nullable Object target); ObservableGroup group(); ObservableTransformer<? super T, T> transform(Observer<? super T> observer); ObservableTransformer<? super T, T> transform(Observer<? super T> observer,
          String observableTag); boolean hasObservables(Observer<?> observer); boolean hasObservable(Observer<?> observer, String observableTag); void initializeAutoTaggingAndResubscription(Object target); void initializeAutoTaggingAndResubscriptionInTargetClassOnly(T target,
          Class<T> targetClass); void cancelAllObservablesForObserver(Observer<?> observer); void cancelAndRemove(Observer<?> observer, String observableTag); void onDestroy(@Nullable Activity activity); void onDestroy(Fragment fragment); void onResume(); void onPause(); void onSaveInstanceState(Bundle outState);  }
@Test public void testSubscribeNoObservables() { when(observableManager.newGroup()).thenReturn(group); GroupLifecycleManager.onCreate(observableManager, null, null); verify(group, never()).resubscribeAll(any(AutoResubscribingObserver.class)); }
@Test public void testCreateWithNoNullTarget() { when(observableManager.newGroup()).thenReturn(group); GroupLifecycleManager.onCreate(observableManager, null, null); verify(group, never()).resubscribeAll(any(AutoResubscribingObserver.class)); verify(group, never()).resubscribeAll(any(TaggedObserver.class)); }