// Path: android-net/src/main/java/li/vin/net/DistanceList.java
// @AutoParcel
// public static abstract class Distance implements Parcelable{
//   /*package*/ static final Type WRAPPED_TYPE = new TypeToken<Wrapped<Distance>>() { }.getType();
// 
//   /*package*/ static final void registerGson(GsonBuilder gb) {
//     gb.registerTypeAdapter(Distance.class, AutoParcelAdapter.create(AutoParcel_DistanceList_Distance.class));
//     gb.registerTypeAdapter(WRAPPED_TYPE, Wrapped.Adapter.create(Distance.class));
//   }
// 
//   public abstract Double confidenceMin();
//   public abstract Double confidenceMax();
//   public abstract Double value();
//   public abstract String lastOdometerDate();
// 
//   public static Observable<Distance> bestDistanceWithVehicleId(@NonNull String vehicleId) {
//     return bestDistanceWithVehicleId(vehicleId, null);
//   }
// 
//   public static Observable<Distance> bestDistanceWithVehicleId(@NonNull String vehicleId,
//       @Nullable DistanceUnit unit) {
//     return Vinli.curApp()
//         .distances()
//         .bestDistance(vehicleId, (unit == null) ? null : unit.getDistanceUnitStr())
//         .map(Wrapped.<Distance>pluckItem());
//   }
// }


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import li.vin.net.DistanceList.Distance;
import rx.Observer;
import rx.Subscriber;
import static junit.framework.Assert.assertTrue;

          @Override public void onError(Throwable e) {
            System.out.println("Error: " + e.getMessage());
            e.printStackTrace();
            assertTrue(false);
          }

          @Override public void onNext(Void aVoid) {

          }
        });
      }
    });

    DistanceList.distancesWithVehicleId(TestHelper.getVehicleId(), (Long) null, null, null).toBlocking().subscribe(new Subscriber<DistanceList>() {
      @Override
      public void onCompleted() {
      }

      @Override
      public void onError(Throwable e) {
        System.out.println("Error: " + e.getMessage());
        e.printStackTrace();
        assertTrue(false);
      }

      @Override
      public void onNext(DistanceList distanceList) {
        assertTrue(distanceList.distances().size() > 0);

// Path: android-net/src/main/java/li/vin/net/DistanceList.java
// @AutoParcel
// public static abstract class Distance implements Parcelable{
//   /*package*/ static final Type WRAPPED_TYPE = new TypeToken<Wrapped<Distance>>() { }.getType();
// 
//   /*package*/ static final void registerGson(GsonBuilder gb) {
//     gb.registerTypeAdapter(Distance.class, AutoParcelAdapter.create(AutoParcel_DistanceList_Distance.class));
//     gb.registerTypeAdapter(WRAPPED_TYPE, Wrapped.Adapter.create(Distance.class));
//   }
// 
//   public abstract Double confidenceMin();
//   public abstract Double confidenceMax();
//   public abstract Double value();
//   public abstract String lastOdometerDate();
// 
//   public static Observable<Distance> bestDistanceWithVehicleId(@NonNull String vehicleId) {
//     return bestDistanceWithVehicleId(vehicleId, null);
//   }
// 
//   public static Observable<Distance> bestDistanceWithVehicleId(@NonNull String vehicleId,
//       @Nullable DistanceUnit unit) {
//     return Vinli.curApp()
//         .distances()
//         .bestDistance(vehicleId, (unit == null) ? null : unit.getDistanceUnitStr())
//         .map(Wrapped.<Distance>pluckItem());
//   }
// }


// Path: android-net/src/test/java/li/vin/net/DistancesIntegrationTests.java
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import li.vin.net.DistanceList.Distance;
import rx.Observer;
import rx.Subscriber;
import static junit.framework.Assert.assertTrue;


          @Override public void onError(Throwable e) {
            System.out.println("Error: " + e.getMessage());
            e.printStackTrace();
            assertTrue(false);
          }

          @Override public void onNext(Void aVoid) {

          }
        });
      }
    });

    DistanceList.distancesWithVehicleId(TestHelper.getVehicleId(), (Long) null, null, null).toBlocking().subscribe(new Subscriber<DistanceList>() {
      @Override
      public void onCompleted() {
      }

      @Override
      public void onError(Throwable e) {
        System.out.println("Error: " + e.getMessage());
        e.printStackTrace();
        assertTrue(false);
      }

      @Override
      public void onNext(DistanceList distanceList) {
        assertTrue(distanceList.distances().size() > 0);

        for(Distance distance : distanceList.distances()){