code: public long getWindowStartTimeForTime(long time) {
  
          //Calculate aggregate offset: aggregate offset is due to both timezone and manual offset
          long aggregateOffset = (timeZone.getOffset(time) + this.offsetAmountMilliseconds) % this.windowSizeMilliseconds;
  
          return (time + aggregateOffset) - (time + aggregateOffset) % this.windowSizeMilliseconds;
      }
docs: Calculates the start time of the window for which the specified time belongs, in unix epoch (millisecond) format<br>
  For example, if the window size is 1 hour with offset 0, then a time 10:17 would return 10:00, as the 1 hour window
  is for 10:00:00.000 to 10:59:59.999 inclusive, or 10:00:00.000 (inclusive) to 11:00:00.000 (exclusive)
  
  @param time Time at which to determine the window start time (milliseconds epoch format)