Annotate public APIs in transition support library

Change-Id: Ibc86b5cecb19d130fff4dae97f0adfe293dc197e
diff --git a/transition/ics/android/support/transition/TransitionManagerIcs.java b/transition/ics/android/support/transition/TransitionManagerIcs.java
index 31e0fdb..19b0175 100644
--- a/transition/ics/android/support/transition/TransitionManagerIcs.java
+++ b/transition/ics/android/support/transition/TransitionManagerIcs.java
@@ -23,13 +23,13 @@
     @Override
     public void setTransition(SceneImpl scene, TransitionImpl transition) {
         mTransitionManager.setTransition(((SceneIcs) scene).mScene,
-                ((TransitionIcs) transition).mTransition);
+                transition == null ? null : ((TransitionIcs) transition).mTransition);
     }
 
     @Override
     public void setTransition(SceneImpl fromScene, SceneImpl toScene, TransitionImpl transition) {
         mTransitionManager.setTransition(((SceneIcs) fromScene).mScene, ((SceneIcs) toScene).mScene,
-                ((TransitionIcs) transition).mTransition);
+                transition == null ? null : ((TransitionIcs) transition).mTransition);
     }
 
     @Override
diff --git a/transition/ics/android/support/transition/TransitionManagerPort.java b/transition/ics/android/support/transition/TransitionManagerPort.java
index 30604e2..7857f57 100644
--- a/transition/ics/android/support/transition/TransitionManagerPort.java
+++ b/transition/ics/android/support/transition/TransitionManagerPort.java
@@ -87,8 +87,11 @@
 
         final ViewGroup sceneRoot = scene.getSceneRoot();
 
-        TransitionPort transitionClone = transition.clone();
-        transitionClone.setSceneRoot(sceneRoot);
+        TransitionPort transitionClone = null;
+        if (transition != null) {
+            transitionClone = transition.clone();
+            transitionClone.setSceneRoot(sceneRoot);
+        }
 
         ScenePort oldScene = ScenePort.getCurrentScene(sceneRoot);
         if (oldScene != null && oldScene.isCreatedFromLayoutResource()) {
diff --git a/transition/ics/android/support/transition/TransitionManagerStaticsIcs.java b/transition/ics/android/support/transition/TransitionManagerStaticsIcs.java
index 4faab87..656ff47 100644
--- a/transition/ics/android/support/transition/TransitionManagerStaticsIcs.java
+++ b/transition/ics/android/support/transition/TransitionManagerStaticsIcs.java
@@ -28,7 +28,7 @@
     @Override
     public void go(SceneImpl scene, TransitionImpl transition) {
         TransitionManagerPort.go(((SceneIcs) scene).mScene,
-                ((TransitionIcs) transition).mTransition);
+                transition == null ? null : ((TransitionIcs) transition).mTransition);
     }
 
     @Override
@@ -39,7 +39,7 @@
     @Override
     public void beginDelayedTransition(ViewGroup sceneRoot, TransitionImpl transition) {
         TransitionManagerPort.beginDelayedTransition(sceneRoot,
-                ((TransitionIcs) transition).mTransition);
+                transition == null ? null : ((TransitionIcs) transition).mTransition);
     }
 
 }
diff --git a/transition/ics/android/support/transition/TransitionPort.java b/transition/ics/android/support/transition/TransitionPort.java
index 85604fc..89643c7 100644
--- a/transition/ics/android/support/transition/TransitionPort.java
+++ b/transition/ics/android/support/transition/TransitionPort.java
@@ -23,12 +23,9 @@
 import android.support.v4.util.LongSparseArray;
 import android.util.Log;
 import android.util.SparseArray;
-import android.view.SurfaceView;
-import android.view.TextureView;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ListView;
-import android.widget.Spinner;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/transition/kitkat/android/support/transition/TransitionManagerKitKat.java b/transition/kitkat/android/support/transition/TransitionManagerKitKat.java
index ed34fd0..a885901 100644
--- a/transition/kitkat/android/support/transition/TransitionManagerKitKat.java
+++ b/transition/kitkat/android/support/transition/TransitionManagerKitKat.java
@@ -25,13 +25,14 @@
     @Override
     public void setTransition(SceneImpl scene, TransitionImpl transition) {
         mTransitionManager.setTransition(((SceneKitKat) scene).mScene,
-                ((TransitionKitKat) transition).mTransition);
+                transition == null ? null : ((TransitionKitKat) transition).mTransition);
     }
 
     @Override
     public void setTransition(SceneImpl fromScene, SceneImpl toScene, TransitionImpl transition) {
         mTransitionManager.setTransition(((SceneKitKat) fromScene).mScene,
-                ((SceneKitKat) toScene).mScene, ((TransitionKitKat) transition).mTransition);
+                ((SceneKitKat) toScene).mScene,
+                transition == null ? null : ((TransitionKitKat) transition).mTransition);
     }
 
     @Override
diff --git a/transition/kitkat/android/support/transition/TransitionManagerStaticsKitKat.java b/transition/kitkat/android/support/transition/TransitionManagerStaticsKitKat.java
index bc14fce..084a4a7 100644
--- a/transition/kitkat/android/support/transition/TransitionManagerStaticsKitKat.java
+++ b/transition/kitkat/android/support/transition/TransitionManagerStaticsKitKat.java
@@ -28,7 +28,7 @@
     @Override
     public void go(SceneImpl scene, TransitionImpl transition) {
         android.transition.TransitionManager.go(((SceneKitKat) scene).mScene,
-                ((TransitionKitKat) transition).mTransition);
+                transition == null ? null : ((TransitionKitKat) transition).mTransition);
     }
 
     @Override
@@ -39,7 +39,7 @@
     @Override
     public void beginDelayedTransition(ViewGroup sceneRoot, TransitionImpl transition) {
         android.transition.TransitionManager.beginDelayedTransition(sceneRoot,
-                ((TransitionKitKat) transition).mTransition);
+                transition == null ? null : ((TransitionKitKat) transition).mTransition);
     }
 
 }
diff --git a/transition/src/android/support/transition/ChangeBounds.java b/transition/src/android/support/transition/ChangeBounds.java
index e31bfd9..abed1c1 100644
--- a/transition/src/android/support/transition/ChangeBounds.java
+++ b/transition/src/android/support/transition/ChangeBounds.java
@@ -18,6 +18,8 @@
 
 import android.animation.Animator;
 import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.view.ViewGroup;
 
 /**
@@ -38,18 +40,19 @@
     }
 
     @Override
-    public void captureEndValues(TransitionValues transitionValues) {
+    public void captureEndValues(@NonNull TransitionValues transitionValues) {
         mImpl.captureEndValues(transitionValues);
     }
 
     @Override
-    public void captureStartValues(TransitionValues transitionValues) {
+    public void captureStartValues(@NonNull TransitionValues transitionValues) {
         mImpl.captureStartValues(transitionValues);
     }
 
     @Override
-    public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues,
-            TransitionValues endValues) {
+    @Nullable
+    public Animator createAnimator(@NonNull ViewGroup sceneRoot,
+            @NonNull TransitionValues startValues, @NonNull TransitionValues endValues) {
         return mImpl.createAnimator(sceneRoot, startValues, endValues);
     }
 
diff --git a/transition/src/android/support/transition/Fade.java b/transition/src/android/support/transition/Fade.java
index 7efaf40..efc71ea 100644
--- a/transition/src/android/support/transition/Fade.java
+++ b/transition/src/android/support/transition/Fade.java
@@ -18,6 +18,8 @@
 
 import android.animation.Animator;
 import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -96,18 +98,19 @@
     }
 
     @Override
-    public void captureEndValues(TransitionValues transitionValues) {
+    public void captureEndValues(@NonNull TransitionValues transitionValues) {
         mImpl.captureEndValues(transitionValues);
     }
 
     @Override
-    public void captureStartValues(TransitionValues transitionValues) {
+    public void captureStartValues(@NonNull TransitionValues transitionValues) {
         mImpl.captureStartValues(transitionValues);
     }
 
     @Override
-    public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues,
-            TransitionValues endValues) {
+    @Nullable
+    public Animator createAnimator(@NonNull ViewGroup sceneRoot,
+            @NonNull TransitionValues startValues, @NonNull TransitionValues endValues) {
         return mImpl.createAnimator(sceneRoot, startValues, endValues);
     }
 
diff --git a/transition/src/android/support/transition/Scene.java b/transition/src/android/support/transition/Scene.java
index 8239570..1fbff9e 100644
--- a/transition/src/android/support/transition/Scene.java
+++ b/transition/src/android/support/transition/Scene.java
@@ -18,6 +18,9 @@
 
 import android.content.Context;
 import android.os.Build;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.util.SparseArray;
 import android.view.View;
 import android.view.ViewGroup;
@@ -53,7 +56,7 @@
      * @param sceneRoot The root of the hierarchy in which scene changes
      *                  and transitions will take place.
      */
-    public Scene(ViewGroup sceneRoot) {
+    public Scene(@NonNull ViewGroup sceneRoot) {
         mImpl = createSceneImpl();
         mImpl.init(sceneRoot);
     }
@@ -68,7 +71,7 @@
      * @param layout    The view hierarchy of this scene, added as a child
      *                  of sceneRoot when this scene is entered.
      */
-    public Scene(ViewGroup sceneRoot, View layout) {
+    public Scene(@NonNull ViewGroup sceneRoot, @NonNull View layout) {
         mImpl = createSceneImpl();
         mImpl.init(sceneRoot, layout);
     }
@@ -92,7 +95,9 @@
      *                  the layout resource.
      * @return The scene for the given root and layout id
      */
-    public static Scene getSceneForLayout(ViewGroup sceneRoot, int layoutId, Context context) {
+    @NonNull
+    public static Scene getSceneForLayout(@NonNull ViewGroup sceneRoot, @LayoutRes int layoutId,
+            @NonNull Context context) {
         @SuppressWarnings("unchecked")
         SparseArray<Scene> scenes =
                 (SparseArray<Scene>) sceneRoot.getTag(R.id.transition_scene_layoutid_cache);
@@ -125,6 +130,7 @@
      *
      * @return The root of the view hierarchy affected by this scene.
      */
+    @NonNull
     public ViewGroup getSceneRoot() {
         return mImpl.getSceneRoot();
     }
@@ -171,7 +177,7 @@
      * @see #setExitAction(Runnable)
      * @see android.support.transition.Scene(android.view.ViewGroup, android.view.ViewGroup)
      */
-    public void setEnterAction(Runnable action) {
+    public void setEnterAction(@Nullable Runnable action) {
         mImpl.setEnterAction(action);
     }
 
@@ -191,7 +197,7 @@
      * @see #setEnterAction(Runnable)
      * @see android.support.transition.Scene(android.view.ViewGroup, android.view.ViewGroup)
      */
-    public void setExitAction(Runnable action) {
+    public void setExitAction(@Nullable Runnable action) {
         mImpl.setExitAction(action);
     }
 
diff --git a/transition/src/android/support/transition/Transition.java b/transition/src/android/support/transition/Transition.java
index a086f70..e3b140e 100644
--- a/transition/src/android/support/transition/Transition.java
+++ b/transition/src/android/support/transition/Transition.java
@@ -20,6 +20,8 @@
 import android.animation.TimeInterpolator;
 import android.os.Build;
 import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.view.SurfaceView;
 import android.view.TextureView;
 import android.view.View;
@@ -82,7 +84,8 @@
      *                 for this animation.
      * @return This transition object.
      */
-    public Transition addListener(TransitionListener listener) {
+    @NonNull
+    public Transition addListener(@NonNull TransitionListener listener) {
         mImpl.addListener(listener);
         return this;
     }
@@ -113,7 +116,8 @@
      * <code>transitionSet.addTransitions(new Fade()).addTarget(someView);</code>
      * @see #addTarget(int)
      */
-    public Transition addTarget(View target) {
+    @NonNull
+    public Transition addTarget(@NonNull View target) {
         mImpl.addTarget(target);
         return this;
     }
@@ -136,6 +140,7 @@
      * <code>transitionSet.addTransitions(new Fade()).addTarget(someId);</code>
      * @see View#getId()
      */
+    @NonNull
     public Transition addTarget(@IdRes int targetId) {
         mImpl.addTarget(targetId);
         return this;
@@ -168,7 +173,7 @@
      * @see #captureStartValues(TransitionValues)
      * @see #createAnimator(ViewGroup, TransitionValues, TransitionValues)
      */
-    public abstract void captureEndValues(TransitionValues transitionValues);
+    public abstract void captureEndValues(@NonNull TransitionValues transitionValues);
 
     /**
      * Captures the values in the start scene for the properties that this
@@ -197,7 +202,7 @@
      * @see #captureEndValues(TransitionValues)
      * @see #createAnimator(ViewGroup, TransitionValues, TransitionValues)
      */
-    public abstract void captureStartValues(TransitionValues transitionValues);
+    public abstract void captureStartValues(@NonNull TransitionValues transitionValues);
 
     /**
      * This method creates an animation that will be run for this transition
@@ -244,8 +249,9 @@
      * overall transition for this scene change. A null value means no animation
      * should be run.
      */
-    public abstract Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues,
-            TransitionValues endValues);
+    @Nullable
+    public abstract Animator createAnimator(@NonNull ViewGroup sceneRoot,
+            @NonNull TransitionValues startValues, @NonNull TransitionValues endValues);
 
     /**
      * Whether to add the children of given target to the list of target children
@@ -267,7 +273,8 @@
      * @see #excludeChildren(int, boolean)
      * @see #excludeChildren(Class, boolean)
      */
-    public Transition excludeChildren(View target, boolean exclude) {
+    @NonNull
+    public Transition excludeChildren(@NonNull View target, boolean exclude) {
         mImpl.excludeChildren(target, exclude);
         return this;
     }
@@ -296,6 +303,7 @@
      * @see #excludeChildren(View, boolean)
      * @see #excludeChildren(Class, boolean)
      */
+    @NonNull
     public Transition excludeChildren(@IdRes int targetId, boolean exclude) {
         mImpl.excludeChildren(targetId, exclude);
         return this;
@@ -322,7 +330,8 @@
      * @see #excludeChildren(int, boolean)
      * @see #excludeChildren(View, boolean)
      */
-    public Transition excludeChildren(Class type, boolean exclude) {
+    @NonNull
+    public Transition excludeChildren(@NonNull Class type, boolean exclude) {
         mImpl.excludeChildren(type, exclude);
         return this;
     }
@@ -347,7 +356,8 @@
      * @see #excludeTarget(int, boolean)
      * @see #excludeTarget(Class, boolean)
      */
-    public Transition excludeTarget(View target, boolean exclude) {
+    @NonNull
+    public Transition excludeTarget(@NonNull View target, boolean exclude) {
         mImpl.excludeTarget(target, exclude);
         return this;
     }
@@ -372,6 +382,7 @@
      * @see #excludeTarget(View, boolean)
      * @see #excludeTarget(Class, boolean)
      */
+    @NonNull
     public Transition excludeTarget(@IdRes int targetId, boolean exclude) {
         mImpl.excludeTarget(targetId, exclude);
         return this;
@@ -397,7 +408,8 @@
      * @see #excludeTarget(int, boolean)
      * @see #excludeTarget(View, boolean)
      */
-    public Transition excludeTarget(Class type, boolean exclude) {
+    @NonNull
+    public Transition excludeTarget(@NonNull Class type, boolean exclude) {
         mImpl.excludeTarget(type, exclude);
         return this;
     }
@@ -424,6 +436,7 @@
      * @return This transition object.
      * @attr ref android.R.styleable#Transition_duration
      */
+    @NonNull
     public Transition setDuration(long duration) {
         mImpl.setDuration(duration);
         return this;
@@ -437,6 +450,7 @@
      * @return The interpolator set on this transition, if one has been set, otherwise
      * returns null.
      */
+    @Nullable
     public TimeInterpolator getInterpolator() {
         return mImpl.getInterpolator();
     }
@@ -451,7 +465,8 @@
      * @return This transition object.
      * @attr ref android.R.styleable#Transition_interpolator
      */
-    public Transition setInterpolator(TimeInterpolator interpolator) {
+    @NonNull
+    public Transition setInterpolator(@Nullable TimeInterpolator interpolator) {
         mImpl.setInterpolator(interpolator);
         return this;
     }
@@ -468,6 +483,7 @@
      *
      * @return The name of this transition.
      */
+    @NonNull
     public String getName() {
         return mImpl.getName();
     }
@@ -494,6 +510,7 @@
      * @return This transition object.
      * @attr ref android.R.styleable#Transition_startDelay
      */
+    @NonNull
     public Transition setStartDelay(long startDelay) {
         mImpl.setStartDelay(startDelay);
         return this;
@@ -508,6 +525,7 @@
      *
      * @return the list of target IDs
      */
+    @NonNull
     public List<Integer> getTargetIds() {
         return mImpl.getTargetIds();
     }
@@ -521,6 +539,7 @@
      *
      * @return the list of target views
      */
+    @NonNull
     public List<View> getTargets() {
         return mImpl.getTargets();
     }
@@ -546,6 +565,7 @@
      * @return An array of property names as described in the class documentation for
      * {@link TransitionValues}. The default implementation returns <code>null</code>.
      */
+    @Nullable
     public String[] getTransitionProperties() {
         return mImpl.getTransitionProperties();
     }
@@ -556,7 +576,8 @@
      * necessary, for example, to query the before/after state of related views
      * for a given transition.
      */
-    public TransitionValues getTransitionValues(View view, boolean start) {
+    @NonNull
+    public TransitionValues getTransitionValues(@NonNull View view, boolean start) {
         return mImpl.getTransitionValues(view, start);
     }
 
@@ -567,7 +588,8 @@
      *                 listeners for this transition.
      * @return This transition object.
      */
-    public Transition removeListener(TransitionListener listener) {
+    @NonNull
+    public Transition removeListener(@NonNull TransitionListener listener) {
         mImpl.removeListener(listener);
         return this;
     }
@@ -582,7 +604,8 @@
      * construction, such as
      * <code>transitionSet.addTransitions(new Fade()).removeTarget(someView);</code>
      */
-    public Transition removeTarget(View target) {
+    @NonNull
+    public Transition removeTarget(@NonNull View target) {
         mImpl.removeTarget(target);
         return this;
     }
@@ -597,6 +620,7 @@
      * construction, such as
      * <code>transitionSet.addTransitions(new Fade()).removeTargetId(someId);</code>
      */
+    @NonNull
     public Transition removeTarget(@IdRes int targetId) {
         mImpl.removeTarget(targetId);
         return this;
@@ -618,7 +642,7 @@
          *
          * @param transition The started transition.
          */
-        void onTransitionStart(Transition transition);
+        void onTransitionStart(@NonNull Transition transition);
 
         /**
          * Notification about the end of the transition. Canceled transitions
@@ -629,7 +653,7 @@
          *
          * @param transition The transition which reached its end.
          */
-        void onTransitionEnd(Transition transition);
+        void onTransitionEnd(@NonNull Transition transition);
 
         /**
          * Notification about the cancellation of the transition.
@@ -641,7 +665,7 @@
          *
          * @param transition The transition which was canceled.
          */
-        void onTransitionCancel(Transition transition);
+        void onTransitionCancel(@NonNull Transition transition);
 
         /**
          * Notification when a transition is paused.
@@ -653,7 +677,7 @@
          *
          * @param transition The transition which was paused.
          */
-        void onTransitionPause(Transition transition);
+        void onTransitionPause(@NonNull Transition transition);
 
         /**
          * Notification when a transition is resumed.
@@ -664,7 +688,7 @@
          *
          * @param transition The transition which was resumed.
          */
-        void onTransitionResume(Transition transition);
+        void onTransitionResume(@NonNull Transition transition);
     }
 
 }
diff --git a/transition/src/android/support/transition/TransitionManager.java b/transition/src/android/support/transition/TransitionManager.java
index 91ca7bf..da9ac08 100644
--- a/transition/src/android/support/transition/TransitionManager.java
+++ b/transition/src/android/support/transition/TransitionManager.java
@@ -18,6 +18,7 @@
 
 import android.os.Build;
 import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.view.ViewGroup;
 
 /**
@@ -79,8 +80,8 @@
      * @param transition The transition to use for this scene change. A
      *                   value of null causes the scene change to happen with no transition.
      */
-    public static void go(@NonNull Scene scene, Transition transition) {
-        sImpl.go(scene.mImpl, transition.mImpl);
+    public static void go(@NonNull Scene scene, @Nullable Transition transition) {
+        sImpl.go(scene.mImpl, transition == null ? null : transition.mImpl);
     }
 
     /**
@@ -92,7 +93,7 @@
      *
      * @param sceneRoot The root of the View hierarchy to run the transition on.
      */
-    public static void beginDelayedTransition(final ViewGroup sceneRoot) {
+    public static void beginDelayedTransition(@NonNull final ViewGroup sceneRoot) {
         sImpl.beginDelayedTransition(sceneRoot);
     }
 
@@ -119,8 +120,9 @@
      * @param transition The transition to use for this change. A
      *                   value of null causes the TransitionManager to use the default transition.
      */
-    public static void beginDelayedTransition(final ViewGroup sceneRoot, Transition transition) {
-        sImpl.beginDelayedTransition(sceneRoot, transition.mImpl);
+    public static void beginDelayedTransition(@NonNull final ViewGroup sceneRoot,
+            @Nullable Transition transition) {
+        sImpl.beginDelayedTransition(sceneRoot, transition == null ? null : transition.mImpl);
     }
 
     /**
@@ -132,8 +134,8 @@
      *                   entered. A value of null will result in the default behavior of
      *                   using the default transition instead.
      */
-    public void setTransition(Scene scene, Transition transition) {
-        mImpl.setTransition(scene.mImpl, transition.mImpl);
+    public void setTransition(@NonNull Scene scene, @Nullable Transition transition) {
+        mImpl.setTransition(scene.mImpl, transition == null ? null : transition.mImpl);
     }
 
     /**
@@ -148,8 +150,10 @@
      *                   entered. A value of null will result in the default behavior of
      *                   using the default transition instead.
      */
-    public void setTransition(Scene fromScene, Scene toScene, Transition transition) {
-        mImpl.setTransition(fromScene.mImpl, toScene.mImpl, transition.mImpl);
+    public void setTransition(@NonNull Scene fromScene, @NonNull Scene toScene,
+            @Nullable Transition transition) {
+        mImpl.setTransition(fromScene.mImpl, toScene.mImpl,
+                transition == null ? null : transition.mImpl);
     }
 
     /**
@@ -160,7 +164,7 @@
      *
      * @param scene The Scene to change to
      */
-    public void transitionTo(Scene scene) {
+    public void transitionTo(@NonNull Scene scene) {
         mImpl.transitionTo(scene.mImpl);
     }
 
diff --git a/transition/src/android/support/transition/TransitionSet.java b/transition/src/android/support/transition/TransitionSet.java
index 8d35394..f43eeb1 100644
--- a/transition/src/android/support/transition/TransitionSet.java
+++ b/transition/src/android/support/transition/TransitionSet.java
@@ -18,6 +18,8 @@
 
 import android.animation.Animator;
 import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.view.ViewGroup;
 
 /**
@@ -81,6 +83,7 @@
      *                 transitions in sequence.
      * @return This transitionSet object.
      */
+    @NonNull
     public TransitionSet setOrdering(int ordering) {
         ((TransitionSetImpl) mImpl).setOrdering(ordering);
         return this;
@@ -99,7 +102,8 @@
      * @param transition A non-null child transition to be added to this set.
      * @return This transitionSet object.
      */
-    public TransitionSet addTransition(Transition transition) {
+    @NonNull
+    public TransitionSet addTransition(@NonNull Transition transition) {
         ((TransitionSetImpl) mImpl).addTransition(transition.mImpl);
         return this;
     }
@@ -110,24 +114,26 @@
      * @param transition The transition to be removed.
      * @return This transitionSet object.
      */
-    public TransitionSet removeTransition(Transition transition) {
+    @NonNull
+    public TransitionSet removeTransition(@NonNull Transition transition) {
         ((TransitionSetImpl) mImpl).removeTransition(transition.mImpl);
         return this;
     }
 
     @Override
-    public void captureEndValues(TransitionValues transitionValues) {
+    public void captureEndValues(@NonNull TransitionValues transitionValues) {
         mImpl.captureEndValues(transitionValues);
     }
 
     @Override
-    public void captureStartValues(TransitionValues transitionValues) {
+    public void captureStartValues(@NonNull TransitionValues transitionValues) {
         mImpl.captureStartValues(transitionValues);
     }
 
     @Override
-    public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues,
-            TransitionValues endValues) {
+    @Nullable
+    public Animator createAnimator(@NonNull ViewGroup sceneRoot,
+            @NonNull TransitionValues startValues, @NonNull TransitionValues endValues) {
         return mImpl.createAnimator(sceneRoot, startValues, endValues);
     }