// Path: library/src/main/java/com/google/android/material/motion/testing/SimulatedMotionSource.java
// public class SimulatedMotionSource<T> extends SimulatedSource<T, MotionObserver<T>> {
// 
//   @Override
//   protected IndefiniteObservable<MotionObserver<T>> createObservable(IndefiniteObservable.Connector<MotionObserver<T>> connector) {
//     return new MotionObservable<>(connector);
//   }
// 
//   @Override
//   public MotionObservable<T> getObservable() {
//     return (MotionObservable<T>) super.getObservable();
//   }
// }
// 
// 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 static com.google.common.truth.Truth.assertThat;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.PointF;
import android.view.View;
import com.google.android.material.motion.testing.SimulatedMotionSource;
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 readWriteBackgroundColorProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).backgroundColor().write(new Integer(Color.RED));

    assertThat(runtime.get(target).backgroundColor().read()).isEqualTo(new Integer(Color.RED));
  }

  @Test
  public void readWriteTranslationXProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).translationX().write(5.0f);

    assertThat(runtime.get(target).translationX().read()).isWithin(0.5f).of(5.0f);
  }

  @Test
  public void readWriteTranslationYProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).translationY().write(9.0f);

    assertThat(runtime.get(target).translationY().read()).isWithin(0.5f).of(9.0f);
  }

  @Test
  public void readWriteTranslationZProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).translationZ().write(7.0f);

// Path: library/src/main/java/com/google/android/material/motion/testing/SimulatedMotionSource.java
// public class SimulatedMotionSource<T> extends SimulatedSource<T, MotionObserver<T>> {
// 
//   @Override
//   protected IndefiniteObservable<MotionObserver<T>> createObservable(IndefiniteObservable.Connector<MotionObserver<T>> connector) {
//     return new MotionObservable<>(connector);
//   }
// 
//   @Override
//   public MotionObservable<T> getObservable() {
//     return (MotionObservable<T>) super.getObservable();
//   }
// }
// 
// 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/MotionRuntimeTests.java
import static com.google.common.truth.Truth.assertThat;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.PointF;
import android.view.View;
import com.google.android.material.motion.testing.SimulatedMotionSource;
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 readWriteBackgroundColorProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).backgroundColor().write(new Integer(Color.RED));

    assertThat(runtime.get(target).backgroundColor().read()).isEqualTo(new Integer(Color.RED));
  }

  @Test
  public void readWriteTranslationXProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).translationX().write(5.0f);

    assertThat(runtime.get(target).translationX().read()).isWithin(0.5f).of(5.0f);
  }

  @Test
  public void readWriteTranslationYProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).translationY().write(9.0f);

    assertThat(runtime.get(target).translationY().read()).isWithin(0.5f).of(9.0f);
  }

  @Test
  public void readWriteTranslationZProperty() {
    View target = new View(Robolectric.setupActivity(Activity.class));
    runtime.get(target).translationZ().write(7.0f);

    assertThat(runtime.get(target).translationZ().read()).isWithin(0.5f).of(7.0f);