package org.bouncycastle.crypto.tls;

class DTLSEpoch {

    private final DTLSReplayWindow replayWindow = new DTLSReplayWindow();

    private final int epoch;
    private final TlsCipher cipher;

    private long sequence_number = 0;

    DTLSEpoch(int epoch, TlsCipher cipher) {
        this.epoch = epoch;
        this.cipher = cipher;
    }

    long allocateSequenceNumber() {
        // TODO Check for overflow
        return sequence_number++;
    }

    TlsCipher getCipher() {
        return cipher;
    }

    int getEpoch() {
        return epoch;
    }

    DTLSReplayWindow getReplayWindow() {
        return replayWindow;
    }

    long getSequence_number() {
        return sequence_number;
    }
}

@@ -283,24 +283,254 @@
  cipher) %7B%0D%0A
+        if (epoch %3C 0) %7B%0D%0A            throw new IllegalArgumentException(%22'epoch' must be %3E= 0%22);%0D%0A        %7D%0D%0A        if (cipher == null) %7B%0D%0A            throw new IllegalArgumentException(%22'cipher' cannot be null%22);%0D%0A        %7D%0D%0A%0D%0A
         this

Add constructor guards