import java.util.Calendar;
import java.util.Date;
class Main{
public static Date getEndDateOfDay(Date day) {
if (day == null) {
return null;
}
Calendar cal = Calendar.getInstance();
cal.setTime(day);
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 59);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.HOUR_OF_DAY, 23);
return cal.getTime();
}
}