// Path: library/src/main/java/com/google/android/material/motion/MotionObserver.java
// public static abstract class SimpleMotionObserver<T> extends MotionObserver<T> {
//   @Override
//   public void build(MotionBuilder<T> builder, T[] values) {
//   }
// }
// 
// Path: library/src/main/java/com/google/android/material/motion/testing/TrackingMotionObserver.java
// public class TrackingMotionObserver<T> extends SimpleMotionObserver<T> {
// 
//   public final List<T> values = new ArrayList<>();
// 
//   @Override
//   public void next(T value) {
//     values.add(value);
//   }
// }


import java.util.Arrays;
import static com.google.common.truth.Truth.assertThat;
import android.app.Activity;
import android.support.annotation.NonNull;
import android.view.View;
import com.google.android.indefinite.observable.IndefiniteObservable;
import com.google.android.indefinite.observable.IndefiniteObservable.Subscription;
import com.google.android.material.motion.MotionObserver.SimpleMotionObserver;
import com.google.android.material.motion.testing.TrackingMotionObserver;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
  @Test
  public void writeUnscopedProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    target.setTranslationX(0);

    runtime.write(observable, target, View.TRANSLATION_X);

    assertThat(target.getTranslationX()).isWithin(E).of(5f);
  }

  @Test
  public void writeReactiveProperty() {
    ReactiveProperty<Float> property = ReactiveProperty.of(100f);

    property.write(5f);

    assertThat(property.read()).isWithin(0f).of(5f);
  }

  @Test
  public void readReactiveProperty() {
    ReactiveProperty<Float> reader = ReactiveProperty.of(6f);

    assertThat(reader.read()).isWithin(E).of(6f);
  }

  @Test
  public void subscribeReactiveProperty() {
    ReactiveProperty<Float> property = ReactiveProperty.of(6f);

// Path: library/src/main/java/com/google/android/material/motion/MotionObserver.java
// public static abstract class SimpleMotionObserver<T> extends MotionObserver<T> {
//   @Override
//   public void build(MotionBuilder<T> builder, T[] values) {
//   }
// }
// 
// Path: library/src/main/java/com/google/android/material/motion/testing/TrackingMotionObserver.java
// public class TrackingMotionObserver<T> extends SimpleMotionObserver<T> {
// 
//   public final List<T> values = new ArrayList<>();
// 
//   @Override
//   public void next(T value) {
//     values.add(value);
//   }
// }


// Path: library/src/test/java/com/google/android/material/motion/MotionObservableTests.java
import java.util.Arrays;
import static com.google.common.truth.Truth.assertThat;
import android.app.Activity;
import android.support.annotation.NonNull;
import android.view.View;
import com.google.android.indefinite.observable.IndefiniteObservable;
import com.google.android.indefinite.observable.IndefiniteObservable.Subscription;
import com.google.android.material.motion.MotionObserver.SimpleMotionObserver;
import com.google.android.material.motion.testing.TrackingMotionObserver;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

  @Test
  public void writeUnscopedProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    target.setTranslationX(0);

    runtime.write(observable, target, View.TRANSLATION_X);

    assertThat(target.getTranslationX()).isWithin(E).of(5f);
  }

  @Test
  public void writeReactiveProperty() {
    ReactiveProperty<Float> property = ReactiveProperty.of(100f);

    property.write(5f);

    assertThat(property.read()).isWithin(0f).of(5f);
  }

  @Test
  public void readReactiveProperty() {
    ReactiveProperty<Float> reader = ReactiveProperty.of(6f);

    assertThat(reader.read()).isWithin(E).of(6f);
  }

  @Test
  public void subscribeReactiveProperty() {
    ReactiveProperty<Float> property = ReactiveProperty.of(6f);

    TrackingMotionObserver<Float> tracker = new TrackingMotionObserver<>();