@@ -0,0 +1,2414 @@
+// Copyright 2019 Google LLC%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     https://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.sps.data;%0A%0Apublic final class TimeRange %7B%0A    %0A    private int start;%0A    private int duration;%0A    private int end;%0A%0A    private TimeRange(int start, int duration) %7B%0A        this.start = start;%0A        this.duration = duration;%0A        this.end = start + duration;%0A    %7D%0A%0A    /** Create new TimeRange with start time (in minutes) and end time (in minutes). */%0A    public static TimeRange fromStartToEnd(int start, int end) %7B%0A        return new TimeRange(start, end - start);%0A    %7D%0A%0A    /** Create new TimeRange with start time (in minutes) and duration (in minutes). */%0A    public static TimeRange fromStartWithDuration(int start, int duration) %7B%0A        return new TimeRange(start, duration);%0A    %7D%0A%0A    public int getStart() %7B%0A        return this.start;%0A    %7D%0A%0A    public int getDuration() %7B%0A        return this.duration;%0A    %7D%0A%0A    public int getEnd() %7B%0A        return this.end;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return getMinutesInTime(start) + %22-%22 + getMinutesInTime(end);%0A    %7D%0A%0A    /** Converts hour:minutes time to minutes. */%0A    public static int getTimeInMinutes(int hours, int minutes) %7B%0A        if (hours %3C 0 %7C%7C hours %3E= 24) %7B%0A            throw new IllegalArgumentException(%22Hours can only be 0 through 23 (inclusive).%22);%0A        %7D%0A%0A        if (minutes %3C 0 %7C%7C minutes %3E= 60) %7B%0A            throw new IllegalArgumentException(%22Minutes can only be 0 through 59 (inclusive).%22);%0A        %7D%0A%0A        return (hours * 60) + minutes;%0A    %7D%0A%0A    /** Converts minute times to hour:minutes time. */%0A    private String getMinutesInTime(int time) %7B%0A        String hour = String.valueOf(time / 60);%0A        String minutes = String.valueOf(time %25 60);%0A%0A        if(minutes.length() %3C 2) %7B%0A            minutes = %220%22 + minutes;%0A        %7D%0A%0A        return hour + %22:%22 + minutes;%0A%0A    %7D%0A%0A%7D%0A

Create TimeRange class to store availability