Record selectRandomRecord(List<Record> recordsList) {

        Preconditions.checkArgument(CollectionUtils.isNotEmpty(recordsList), "Records list can not be empty.");

        LOG.debug("Selecting a random Record from the sample list.");
        return recordsList.get(new Random().nextInt(recordsList.size()));
    }
@Test
    public void testSelectRandomRecord() {

        // Test empty list
        List<Record> fakeRecordList = new ArrayList<>();
        AssertionsForClassTypes.assertThatThrownBy(() -> kinesisService.selectRandomRecord(fakeRecordList))
                .isExactlyInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining("Records list can not be empty.");

        // Test list with records
        fakeRecordList.add(Record.builder().build());
        fakeRecordList.add(Record.builder().build());
        fakeRecordList.add(Record.builder().build());
        Record record = kinesisService.selectRandomRecord(fakeRecordList);

        // Test a record returns
        assertNotNull(record);
    }