### Question:
KinesisStreamRecordSender implements RecordSender { @Override public boolean isRecoverable(AmazonClientException ace) { if (ace instanceof AmazonServiceException) { final String errorCode = ((AmazonServiceException) ace).getErrorCode(); return "InternalFailure".equals(errorCode) || "ServiceUnavailable".equals(errorCode) || "Throttling".equals(errorCode) || "ProvisionedThroughputExceededException".equals(errorCode); } else { return ace.getCause() != null && ace.getCause() instanceof IOException; } } KinesisStreamRecordSender(AmazonKinesis client, String userAgent);  KinesisStreamRecordSender(AmazonKinesis client, String userAgent,
            String partitionKey); @Override List<byte[]> sendBatch(String streamName, List<byte[]> data); @Override boolean isRecoverable(AmazonClientException ace);  }### Answer:
@Test public void testIsRecoverableClientException() { AmazonClientException aceNoCause = new AmazonClientException("failure"); assertFalse(sender.isRecoverable(aceNoCause)); AmazonClientException aceOtherCause = new AmazonClientException("failure", new NullPointerException()); assertFalse(sender.isRecoverable(aceOtherCause)); AmazonClientException aceWithIOException = new AmazonClientException("failure", new IOException()); assertTrue(sender.isRecoverable(aceWithIOException)); }
@Test public void testIsRecoverableServiceException() { assertFalse(sender.isRecoverable(getServiceException(""))); assertTrue(sender.isRecoverable(getServiceException("InternalFailure"))); assertTrue(sender.isRecoverable(getServiceException("ServiceUnavailable"))); assertTrue(sender.isRecoverable(getServiceException("Throttling"))); assertTrue(sender .isRecoverable(getServiceException("ProvisionedThroughputExceededException"))); }