// Path: app/src/main/java/org/secuso/privacyfriendlyweather/util/TimeUtil.java
// public class TimeUtil {
//     private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm", Locale.getDefault());
// 
//     public static long getStartOfDay(int timezoneInSeconds) {
//         return getStartOfDayCustomCurrentTime(timezoneInSeconds, System.currentTimeMillis());
//     }
// 
//     public static long getStartOfDayCustomCurrentTime(int timezoneInSeconds, long currentTime) {
//         Calendar cal = Calendar.getInstance();
//         cal.setTimeZone(TimeZone.getTimeZone("GMT"));
//         cal.set(Calendar.DST_OFFSET, 0);
//         cal.setTimeInMillis(currentTime);
//         cal.set(Calendar.HOUR_OF_DAY, 0);
//         cal.set(Calendar.MINUTE, 0);
//         cal.set(Calendar.ZONE_OFFSET, timezoneInSeconds);
// 
//         long startOfDay = cal.getTimeInMillis();
//         //Log.d("devtag", "calendar " + cal.getTimeInMillis() + cal.getTime());
// 
//         if (currentTime < startOfDay) {
//             cal.add(Calendar.HOUR_OF_DAY, -24);
//         }
//         if (currentTime > startOfDay + 24 * 3600 * 1000) {
//             cal.add(Calendar.HOUR_OF_DAY, 24);
//         }
//         return cal.getTimeInMillis();
//     }
// 
//     public static String formatTimeSimple(int timeZoneSeconds, long timeInSeconds) {
//         timeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
//         Date dateTime = new Date((timeInSeconds + timeZoneSeconds) * 1000L);
//         return timeFormat.format(dateTime);
//     }
// }


import org.junit.Test;
import org.secuso.privacyfriendlyweather.util.TimeUtil;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
package org.secuso.privacyfriendlyweather;




/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class TimeTest {

    @Test
    public void testTimeStartOfDay() {
        long currentTime = 1599659833857L;
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/util/TimeUtil.java
// public class TimeUtil {
//     private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm", Locale.getDefault());
// 
//     public static long getStartOfDay(int timezoneInSeconds) {
//         return getStartOfDayCustomCurrentTime(timezoneInSeconds, System.currentTimeMillis());
//     }
// 
//     public static long getStartOfDayCustomCurrentTime(int timezoneInSeconds, long currentTime) {
//         Calendar cal = Calendar.getInstance();
//         cal.setTimeZone(TimeZone.getTimeZone("GMT"));
//         cal.set(Calendar.DST_OFFSET, 0);
//         cal.setTimeInMillis(currentTime);
//         cal.set(Calendar.HOUR_OF_DAY, 0);
//         cal.set(Calendar.MINUTE, 0);
//         cal.set(Calendar.ZONE_OFFSET, timezoneInSeconds);
// 
//         long startOfDay = cal.getTimeInMillis();
//         //Log.d("devtag", "calendar " + cal.getTimeInMillis() + cal.getTime());
// 
//         if (currentTime < startOfDay) {
//             cal.add(Calendar.HOUR_OF_DAY, -24);
//         }
//         if (currentTime > startOfDay + 24 * 3600 * 1000) {
//             cal.add(Calendar.HOUR_OF_DAY, 24);
//         }
//         return cal.getTimeInMillis();
//     }
// 
//     public static String formatTimeSimple(int timeZoneSeconds, long timeInSeconds) {
//         timeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
//         Date dateTime = new Date((timeInSeconds + timeZoneSeconds) * 1000L);
//         return timeFormat.format(dateTime);
//     }
// }


// Path: app/src/test/java/org/secuso/privacyfriendlyweather/TimeTest.java
import org.junit.Test;
import org.secuso.privacyfriendlyweather.util.TimeUtil;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

package org.secuso.privacyfriendlyweather;




/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class TimeTest {

    @Test
    public void testTimeStartOfDay() {
        long currentTime = 1599659833857L;
        long startOfDay = TimeUtil.getStartOfDayCustomCurrentTime(3 * 3600, currentTime);