public void startNewBlock(GregorianCalendar timestamp, int dataUntilNextHeader) {
      GB.assertThat(timestamp != null, "Timestamp must not be null");

      if (isFirstChunk()) {
        activityDataTimestampProgress = timestamp;
      } else {
        if (timestamp.getTimeInMillis() >= activityDataTimestampProgress.getTimeInMillis()) {
          activityDataTimestampProgress = timestamp;
        } else {
          // something is fishy here... better not trust the given timestamp and simply
          // (re)use the current one
          // we do accept the timestamp to ack though, so that the bogus data is properly cleared on
          // the band
          LOG.warn(
              "Got bogus timestamp: "
                  + timestamp.getTime()
                  + " that is smaller than the previous timestamp: "
                  + activityDataTimestampProgress.getTime());
        }
      }
      activityDataTimestampToAck = (GregorianCalendar) timestamp.clone();
      activityDataRemainingBytes = activityDataUntilNextHeader = dataUntilNextHeader;
      validate();
    }
 private void validate() {
   GB.assertThat(activityDataRemainingBytes >= 0, "Illegal state, remaining bytes is negative");
 }