cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTimeInMillis();
}
<BUG>private static Calendar roundDownField(long timestamp, int field, int roundDown) {

Preconditions.checkArgument(timestamp > 0, "Timestamp must be positive");
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(timestamp);</BUG>
int fieldVal = cal.get(field);

cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTimeInMillis();
}
private static Calendar roundDownField(long timestamp, int field, int roundDown,
TimeZone timeZone) {
Preconditions.checkArgument(timestamp > 0, "Timestamp must be positive");
Calendar cal = (timeZone == null) ? Calendar.getInstance() : Calendar.getInstance(timeZone);
cal.setTimeInMillis(timestamp);
int fieldVal = cal.get(field);
