/*
 * Copyright (c) 2017-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
package com.facebook.litho;

import java.util.ArrayList;

import com.facebook.litho.internal.ArraySet;

/**
 * A set of {@link Transition}s.
 */
public class TransitionSet {

  private final ArrayList<Transition> mTransitions = new ArrayList<>();
  private final ArraySet<String> mKeysWithDisappearAnimations = new ArraySet<>();

  TransitionSet(Transition.Builder... transitionBuilders) {
    for (int i = 0; i < transitionBuilders.length; i++) {
      mTransitions.addAll(transitionBuilders[i].getTransitions());
    }
  }

  boolean hasDisappearAnimation(String key) {
    return mKeysWithDisappearAnimations.contains(key);
  }

  ArrayList<Transition> getTransitions() {
    return mTransitions;
  }

  void mergeIn(TransitionSet set) {
    mTransitions.addAll(set.mTransitions);
    mKeysWithDisappearAnimations.addAll(set.mKeysWithDisappearAnimations);
  }

  void clear() {
    mTransitions.clear();
    mKeysWithDisappearAnimations.clear();
  }
}

@@ -363,54 +363,8 @@
 t;%0A%0A
-import com.facebook.litho.internal.ArraySet;%0A%0A
 /**%0A
@@ -505,90 +505,8 @@
 %3E();
-%0A  private final ArraySet%3CString%3E mKeysWithDisappearAnimations = new ArraySet%3C%3E();
 %0A%0A  
@@ -703,114 +703,8 @@
  %7D%0A%0A
-  boolean hasDisappearAnimation(String key) %7B%0A    return mKeysWithDisappearAnimations.contains(key);%0A  %7D%0A%0A
   Ar
@@ -857,156 +857,39 @@
 ;%0A  
-  mKeysWithDisappearAnimations.addAll(set.mKeysWithDisappearAnimations);%0A  %7D%0A%0A  void clear() %7B%0A    mTransitions.clear();%0A    mKeysWithDisappearAnima
+%7D%0A%0A  void clear() %7B%0A    mTransi
 tion

Remove tracking disappearing keys from TransitionSet