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