Source:
<code>private SleepEvents<Segment> aggregate(final SleepEvents<Segment> defaultEvents){ final List<ClusterAmplitudeData> clusterCopy = this.motionCluster.getCopyOfClusters(); Segment inBed = defaultEvents.goToBed; Segment sleep = defaultEvents.fallAsleep; final Pair<Long, Long> sleepTimesMillis = safeGuardPickSleep(this.sleepPeriod, clusterCopy, this.getAggregatedFeatures(), defaultEvents.fallAsleep.getStartTimestamp()); long sleepTimeMillis = sleepTimesMillis.getSecond(); inBed = new Segment(sleepTimesMillis.getFirst(), sleepTimesMillis.getFirst() + DateTimeConstants.MILLIS_PER_MINUTE, sleep.getOffsetMillis()); sleep = new Segment(sleepTimeMillis, sleepTimeMillis + DateTimeConstants.MILLIS_PER_MINUTE, defaultEvents.fallAsleep.getOffsetMillis()); if(inBed.getStartTimestamp() > sleep.getStartTimestamp()){ inBed = new Segment(sleep.getStartTimestamp() - 10 * DateTimeConstants.MILLIS_PER_MINUTE, sleep.getStartTimestamp() - 9 * DateTimeConstants.MILLIS_PER_MINUTE, sleep.getOffsetMillis()); } Segment wakeUp = defaultEvents.wakeUp; Segment outBed = defaultEvents.outOfBed; final Pair<Long, Long> wakeUpTimesMillis = safeGuardPickWakeUp(clusterCopy, sleepPeriod, getAggregatedFeatures(), defaultEvents.wakeUp.getStartTimestamp()); wakeUp = new Segment(wakeUpTimesMillis.getFirst(), wakeUpTimesMillis.getFirst() + DateTimeConstants.MILLIS_PER_MINUTE, wakeUp.getOffsetMillis()); <START> outBed = new Segment(wakeUpTimesMillis.getSecond(), wakeUpTimesMillis.getSecond() + DateTimeConstants.MILLIS_PER_MINUTE, wakeUp.getOffsetMillis()); <END> return SleepEvents.create(inBed, sleep, wakeUp, outBed); }</code><technical_language>is this bug led find utc issue</technical_language>

Target:
private SleepEvents<Segment> aggregate(final SleepEvents<Segment> defaultEvents){ final List<ClusterAmplitudeData> clusterCopy = this.motionCluster.getCopyOfClusters(); Segment inBed = defaultEvents.goToBed; Segment sleep = defaultEvents.fallAsleep; final Pair<Long, Long> sleepTimesMillis = safeGuardPickSleep(this.sleepPeriod, clusterCopy, this.getAggregatedFeatures(), defaultEvents.fallAsleep.getStartTimestamp()); long sleepTimeMillis = sleepTimesMillis.getSecond(); inBed = new Segment(sleepTimesMillis.getFirst(), sleepTimesMillis.getFirst() + DateTimeConstants.MILLIS_PER_MINUTE, sleep.getOffsetMillis()); sleep = new Segment(sleepTimeMillis, sleepTimeMillis + DateTimeConstants.MILLIS_PER_MINUTE, defaultEvents.fallAsleep.getOffsetMillis()); if(inBed.getStartTimestamp() > sleep.getStartTimestamp()){ inBed = new Segment(sleep.getStartTimestamp() - 10 * DateTimeConstants.MILLIS_PER_MINUTE, sleep.getStartTimestamp() - 9 * DateTimeConstants.MILLIS_PER_MINUTE, sleep.getOffsetMillis()); } Segment wakeUp = defaultEvents.wakeUp; Segment outBed = defaultEvents.outOfBed; final Pair<Long, Long> wakeUpTimesMillis = safeGuardPickWakeUp(clusterCopy, sleepPeriod, getAggregatedFeatures(), defaultEvents.wakeUp.getStartTimestamp()); wakeUp = new Segment(wakeUpTimesMillis.getFirst(), wakeUpTimesMillis.getFirst() + DateTimeConstants.MILLIS_PER_MINUTE, wakeUp.getOffsetMillis()); outBed = new Segment(wakeUpTimesMillis.getSecond(), wakeUpTimesMillis.getSecond() + DateTimeConstants.MILLIS_PER_MINUTE, outBed.getOffsetMillis()); return SleepEvents.create(inBed, sleep, wakeUp, outBed); }