// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());
// 
// Path: java-schema-sdk/src/main/java/org/openmhealth/schema/domain/omh/TimeInterval.java
// public static TimeInterval ofStartDateTimeAndEndDateTime(OffsetDateTime startDateTime, OffsetDateTime endDateTime) {
// 
//     checkNotNull(startDateTime, "A start date time hasn't been specified.");
//     checkNotNull(endDateTime, "An end date time hasn't been specified.");
//     checkArgument(!endDateTime.isBefore(startDateTime), "The specified start and end date times are reversed.");
// 
//     TimeInterval timeInterval = new TimeInterval();
// 
//     timeInterval.startDateTime = startDateTime;
//     timeInterval.endDateTime = endDateTime;
// 
//     return timeInterval;
// }


import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.PercentUnit.PERCENT;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
import static org.openmhealth.schema.domain.omh.TimeInterval.ofStartDateTimeAndEndDateTime;
        assertThat(bodyFatPercentage.getBodyFatPercentage().getTypedUnit(), equalTo(PERCENT));
        assertThat(bodyFatPercentage.getBodyFatPercentage().getValue().doubleValue(), equalTo(22.3));

        assertThat(bodyFatPercentage.getEffectiveTimeFrame(), nullValue());
        assertThat(bodyFatPercentage.getDescriptiveStatistic(), nullValue());
        assertThat(bodyFatPercentage.getUserNotes(), nullValue());
    }

    @Test
    public void buildShouldConstructMeasureUsingOptionalProperties() {

        BodyFatPercentage bodyFatPercentage = new BodyFatPercentage.Builder(new TypedUnitValue<>(PERCENT, 31))
                .setDescriptiveStatistic(MAXIMUM)
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)
                .setUserNotes("some note")
                .build();

        assertThat(bodyFatPercentage, notNullValue());
        assertThat(bodyFatPercentage.getBodyFatPercentage().getTypedUnit(), equalTo(PERCENT));
        assertThat(bodyFatPercentage.getBodyFatPercentage().getValue().intValue(), equalTo(31));
        assertThat(bodyFatPercentage.getDescriptiveStatistic(), equalTo(MAXIMUM));
        assertThat(bodyFatPercentage.getEffectiveTimeFrame(), equalTo(FIXED_POINT_IN_TIME));
        assertThat(bodyFatPercentage.getUserNotes(), equalTo("some note"));
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        BodyFatPercentage bodyFatPercentage = new BodyFatPercentage.Builder(new TypedUnitValue<>(PERCENT, 16))
                .setDescriptiveStatistic(MAXIMUM)
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());
// 
// Path: java-schema-sdk/src/main/java/org/openmhealth/schema/domain/omh/TimeInterval.java
// public static TimeInterval ofStartDateTimeAndEndDateTime(OffsetDateTime startDateTime, OffsetDateTime endDateTime) {
// 
//     checkNotNull(startDateTime, "A start date time hasn't been specified.");
//     checkNotNull(endDateTime, "An end date time hasn't been specified.");
//     checkArgument(!endDateTime.isBefore(startDateTime), "The specified start and end date times are reversed.");
// 
//     TimeInterval timeInterval = new TimeInterval();
// 
//     timeInterval.startDateTime = startDateTime;
//     timeInterval.endDateTime = endDateTime;
// 
//     return timeInterval;
// }


// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/BodyFatPercentageUnitTests.java
import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.PercentUnit.PERCENT;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
import static org.openmhealth.schema.domain.omh.TimeInterval.ofStartDateTimeAndEndDateTime;

        assertThat(bodyFatPercentage.getBodyFatPercentage().getTypedUnit(), equalTo(PERCENT));
        assertThat(bodyFatPercentage.getBodyFatPercentage().getValue().doubleValue(), equalTo(22.3));

        assertThat(bodyFatPercentage.getEffectiveTimeFrame(), nullValue());
        assertThat(bodyFatPercentage.getDescriptiveStatistic(), nullValue());
        assertThat(bodyFatPercentage.getUserNotes(), nullValue());
    }

    @Test
    public void buildShouldConstructMeasureUsingOptionalProperties() {

        BodyFatPercentage bodyFatPercentage = new BodyFatPercentage.Builder(new TypedUnitValue<>(PERCENT, 31))
                .setDescriptiveStatistic(MAXIMUM)
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)
                .setUserNotes("some note")
                .build();

        assertThat(bodyFatPercentage, notNullValue());
        assertThat(bodyFatPercentage.getBodyFatPercentage().getTypedUnit(), equalTo(PERCENT));
        assertThat(bodyFatPercentage.getBodyFatPercentage().getValue().intValue(), equalTo(31));
        assertThat(bodyFatPercentage.getDescriptiveStatistic(), equalTo(MAXIMUM));
        assertThat(bodyFatPercentage.getEffectiveTimeFrame(), equalTo(FIXED_POINT_IN_TIME));
        assertThat(bodyFatPercentage.getUserNotes(), equalTo("some note"));
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        BodyFatPercentage bodyFatPercentage = new BodyFatPercentage.Builder(new TypedUnitValue<>(PERCENT, 16))
                .setDescriptiveStatistic(MAXIMUM)
                .setEffectiveTimeFrame(FIXED_MONTH)