### Question:
RetryOrCLDowngradeRetryPolicy implements RetryPolicy { @Override public RetryDecision onWriteTimeout(Statement statement, ConsistencyLevel cl, WriteType writeType, int requiredAcks, int receivedAcks, int nbRetry) { return readAndWriteRetryPolicy.onWriteTimeout(statement, cl, writeType, requiredAcks, receivedAcks, nbRetry); } RetryOrCLDowngradeRetryPolicy(CassandraConfiguration cassandraConfiguration, RetryPolicy readAndWriteRetryPolicy); @Override RetryDecision onReadTimeout(Statement statement, ConsistencyLevel cl, int requiredResponses, int receivedResponses, boolean dataRetrieved, int nbRetry); @Override RetryDecision onWriteTimeout(Statement statement, ConsistencyLevel cl, WriteType writeType, int requiredAcks, int receivedAcks, int nbRetry); @Override RetryDecision onUnavailable(Statement statement, ConsistencyLevel cl, int requiredReplica, int aliveReplica, int nbRetry);  }### Answer:
@Test public void onWriteTimeoutShouldDelegate() { int numberOfRetry = MAX_NUMBER_OF_RETRY - 1; RetryDecision expectedRetryDecision = RetryDecision.rethrow(); ConsistencyLevel consistencyLevel = ConsistencyLevel.QUORUM; WriteType writeType = WriteType.BATCH; int requiredAcks = 1; int receivedAcks = 1; expect(readAndWriteRetryPolicy.onWriteTimeout(statement, consistencyLevel, writeType, requiredAcks, receivedAcks, numberOfRetry)) .andReturn(expectedRetryDecision); control.replay(); RetryOrCLDowngradeRetryPolicy retryOrCLDowngradeRetryPolicy = new RetryOrCLDowngradeRetryPolicy(cassandraConfiguration, readAndWriteRetryPolicy); RetryDecision retryDecision = retryOrCLDowngradeRetryPolicy.onWriteTimeout(statement, consistencyLevel, writeType, requiredAcks, receivedAcks, numberOfRetry); control.verify(); assertThat(retryDecision).isEqualTo(expectedRetryDecision); }