// Path: app/src/main/java/hrv/band/app/model/Measurement.java
// public class Measurement implements Parcelable {
// 
//     // this is used to regenerate your object. All Parcelables must have a CREATOR that implements these two methods
//     public static final Parcelable.Creator<Measurement> CREATOR = new Parcelable.Creator<Measurement>() {
//         @Override
//         public Measurement createFromParcel(Parcel in) {
//             return new Measurement(in);
//         }
//         @Override
//         public Measurement[] newArray(int size) {
//             return new Measurement[size];
//         }
//     };
//     private final Date time;
//     private final double[] rrIntervals;
//     private final double rating;
//     private final MeasurementCategoryAdapter.MeasureCategory category;
//     private final String note;
// 
//     // example constructor that takes a Parcel and gives you an object populated with it's values
//     private Measurement(Parcel in) {
//         this.time = (Date) in.readValue(getClass().getClassLoader());
// 
//         int rrIntervalLength= in.readInt();
//         this.rrIntervals = new double[rrIntervalLength];
//         in.readDoubleArray(rrIntervals);
//         this.rating = in.readDouble();
//         this.category = (MeasurementCategoryAdapter.MeasureCategory) in.readSerializable();
//         this.note = in.readString();
//     }
// 
//     public Measurement(MeasurementBuilder builder) {
//         this.time = builder.time;
//         this.rrIntervals = builder.rrIntervals;
//         this.rating = builder.rating;
//         this.category = builder.category;
//         this.note = builder.note;
//     }
// 
//     /**
//      * Creates a new HRVParameter-Object from a ALLHRVIndiceCalculator object
//      * At the time the data unit can not be changed according to the incoming data
//      * thats why the data has to be converted to the units given in the HRVValue class
//      *
//      * @param time Time when the measurement began
//      * @param rr   Original RR-Data
//      * @return New Measurement object
//      */
//     public static MeasurementBuilder from(Date time, double[] rr) {
// 
//         return new MeasurementBuilder(time, rr);
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     // write your object's data to the passed-in Parcel
//     @Override
//     public void writeToParcel(Parcel out, int flags) {
//         out.writeValue(time);
//         out.writeInt(rrIntervals.length);
//         out.writeDoubleArray(rrIntervals);
//         out.writeDouble(rating);
//         out.writeSerializable(category);
//         out.writeString(note);
//     }
// 
//     public Date getTime() {
//         return time;
//     }
// 
//     public double[] getRRIntervals() {
//         return rrIntervals;
//     }
// 
//     public double getRating() {
//         return rating;
//     }
// 
//     public MeasurementCategoryAdapter.MeasureCategory getCategory() {
//         if (category == null) {
//             return MeasurementCategoryAdapter.MeasureCategory.GENERAL;
//         }
//         return category;
//     }
// 
//     public String getNote() {
//         if (note == null) {
//             return "";
//         }
//         return note;
//     }
// 
//     @Override
//     public boolean equals(Object other)
//     {
//         if(other == null) {
//             return false;
//         }
//         if(other == this) {
//             return true;
//         }
//         if(!(other instanceof Measurement)) {
//             return false;
//         }
// 
//         Measurement param = (Measurement)other;
// 
//         return param.getTime().equals(this.getTime());
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hashCode(getTime());
//     }
// 
//     /**
//      * Class builder for {@link Measurement}.
//      */
//     public static class MeasurementBuilder {
//         private Date time;
//         private double[] rrIntervals;
//         private double rating;
//         private MeasurementCategoryAdapter.MeasureCategory category;
//         private String note;
// 
//         public MeasurementBuilder(Date time, double[] rrIntervals) {
//             this.time = time;
//             this.rrIntervals = rrIntervals;
//         }
// 
//         public MeasurementBuilder(Measurement parameter) {
//             this.time = parameter.getTime();
//             this.rrIntervals = parameter.getRRIntervals();
//         }
// 
// 
//         public MeasurementBuilder rating(double rating) {
//             this.rating = rating;
//             return this;
//         }
//         public MeasurementBuilder category(MeasurementCategoryAdapter.MeasureCategory category) {
//             this.category = category;
//             return this;
//         }
//         public MeasurementBuilder note(String note) {
//             this.note = note;
//             return this;
//         }
// 
//         public Measurement build() {
//             return new Measurement(this);
//         }
//     }
// }


import android.os.Build;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.support.v4.SupportFragmentTestUtil;
import java.util.Date;
import hrv.band.app.BuildConfig;
import hrv.band.app.model.Measurement;
import hrv.band.app.ui.view.fragment.MeasuredRRFragment;
import static junit.framework.Assert.assertNotNull;
package ui.view.fragment;






/**
 * Copyright (c) 2017
 * Created by Thomas Czogalik on 31.01.2017
 *
 * Tests for {@link MeasuredRRFragment}
 */

@Config(constants = BuildConfig.class, sdk = {Build.VERSION_CODES.LOLLIPOP/*, Build.VERSION_CODES.KITKAT*/})
@RunWith(RobolectricTestRunner.class)
public class MeasureRRFragmentTest {

    private static Measurement parameter;
    private MeasuredRRFragment fragment;

    @BeforeClass
    public static void init() {
// Path: app/src/main/java/hrv/band/app/model/Measurement.java
// public class Measurement implements Parcelable {
// 
//     // this is used to regenerate your object. All Parcelables must have a CREATOR that implements these two methods
//     public static final Parcelable.Creator<Measurement> CREATOR = new Parcelable.Creator<Measurement>() {
//         @Override
//         public Measurement createFromParcel(Parcel in) {
//             return new Measurement(in);
//         }
//         @Override
//         public Measurement[] newArray(int size) {
//             return new Measurement[size];
//         }
//     };
//     private final Date time;
//     private final double[] rrIntervals;
//     private final double rating;
//     private final MeasurementCategoryAdapter.MeasureCategory category;
//     private final String note;
// 
//     // example constructor that takes a Parcel and gives you an object populated with it's values
//     private Measurement(Parcel in) {
//         this.time = (Date) in.readValue(getClass().getClassLoader());
// 
//         int rrIntervalLength= in.readInt();
//         this.rrIntervals = new double[rrIntervalLength];
//         in.readDoubleArray(rrIntervals);
//         this.rating = in.readDouble();
//         this.category = (MeasurementCategoryAdapter.MeasureCategory) in.readSerializable();
//         this.note = in.readString();
//     }
// 
//     public Measurement(MeasurementBuilder builder) {
//         this.time = builder.time;
//         this.rrIntervals = builder.rrIntervals;
//         this.rating = builder.rating;
//         this.category = builder.category;
//         this.note = builder.note;
//     }
// 
//     /**
//      * Creates a new HRVParameter-Object from a ALLHRVIndiceCalculator object
//      * At the time the data unit can not be changed according to the incoming data
//      * thats why the data has to be converted to the units given in the HRVValue class
//      *
//      * @param time Time when the measurement began
//      * @param rr   Original RR-Data
//      * @return New Measurement object
//      */
//     public static MeasurementBuilder from(Date time, double[] rr) {
// 
//         return new MeasurementBuilder(time, rr);
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     // write your object's data to the passed-in Parcel
//     @Override
//     public void writeToParcel(Parcel out, int flags) {
//         out.writeValue(time);
//         out.writeInt(rrIntervals.length);
//         out.writeDoubleArray(rrIntervals);
//         out.writeDouble(rating);
//         out.writeSerializable(category);
//         out.writeString(note);
//     }
// 
//     public Date getTime() {
//         return time;
//     }
// 
//     public double[] getRRIntervals() {
//         return rrIntervals;
//     }
// 
//     public double getRating() {
//         return rating;
//     }
// 
//     public MeasurementCategoryAdapter.MeasureCategory getCategory() {
//         if (category == null) {
//             return MeasurementCategoryAdapter.MeasureCategory.GENERAL;
//         }
//         return category;
//     }
// 
//     public String getNote() {
//         if (note == null) {
//             return "";
//         }
//         return note;
//     }
// 
//     @Override
//     public boolean equals(Object other)
//     {
//         if(other == null) {
//             return false;
//         }
//         if(other == this) {
//             return true;
//         }
//         if(!(other instanceof Measurement)) {
//             return false;
//         }
// 
//         Measurement param = (Measurement)other;
// 
//         return param.getTime().equals(this.getTime());
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hashCode(getTime());
//     }
// 
//     /**
//      * Class builder for {@link Measurement}.
//      */
//     public static class MeasurementBuilder {
//         private Date time;
//         private double[] rrIntervals;
//         private double rating;
//         private MeasurementCategoryAdapter.MeasureCategory category;
//         private String note;
// 
//         public MeasurementBuilder(Date time, double[] rrIntervals) {
//             this.time = time;
//             this.rrIntervals = rrIntervals;
//         }
// 
//         public MeasurementBuilder(Measurement parameter) {
//             this.time = parameter.getTime();
//             this.rrIntervals = parameter.getRRIntervals();
//         }
// 
// 
//         public MeasurementBuilder rating(double rating) {
//             this.rating = rating;
//             return this;
//         }
//         public MeasurementBuilder category(MeasurementCategoryAdapter.MeasureCategory category) {
//             this.category = category;
//             return this;
//         }
//         public MeasurementBuilder note(String note) {
//             this.note = note;
//             return this;
//         }
// 
//         public Measurement build() {
//             return new Measurement(this);
//         }
//     }
// }


// Path: app/src/test/java/ui/view/fragment/MeasureRRFragmentTest.java
import android.os.Build;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.support.v4.SupportFragmentTestUtil;
import java.util.Date;
import hrv.band.app.BuildConfig;
import hrv.band.app.model.Measurement;
import hrv.band.app.ui.view.fragment.MeasuredRRFragment;
import static junit.framework.Assert.assertNotNull;

package ui.view.fragment;






/**
 * Copyright (c) 2017
 * Created by Thomas Czogalik on 31.01.2017
 *
 * Tests for {@link MeasuredRRFragment}
 */

@Config(constants = BuildConfig.class, sdk = {Build.VERSION_CODES.LOLLIPOP/*, Build.VERSION_CODES.KITKAT*/})
@RunWith(RobolectricTestRunner.class)
public class MeasureRRFragmentTest {

    private static Measurement parameter;
    private MeasuredRRFragment fragment;

    @BeforeClass
    public static void init() {
        Measurement.MeasurementBuilder builder = new Measurement.MeasurementBuilder(new Date(1000), new double[] {1,1,1,1,1});