integration-tests/src/test/java/com/kdgregory/aws/utils/KinesisIntegrationTest.java
/**
     *  Reads up to an expected number of messages from the stream, using the
     *  specified writer (which may have been used before), timing out after
     *  10 seconds.
     */
Reads up to an expected number of messages from the stream, using the
specified writer (which may have been used before), timing out after
10 seconds.
Reads up to an expected number of messages from the stream using the specified writer ( which may have been used before ) timing out after 10 seconds .
private List<Record> readMessages(KinesisReader reader, int expectedMessages)
    throws Exception
    {
        List<Record> result = new ArrayList<Record>();
        long timeoutAt = System.currentTimeMillis() + 10000;
        while ((result.size() < expectedMessages) && (System.currentTimeMillis() < timeoutAt))
        {
            for (Record record : reader)
            {
                result.add(record);
            }
        }
        return result;
    }
private List < Record > readMessages ( KinesisReader reader , int expectedMessages ) throws Exception { List < Record > result = new ArrayList < Record > ( ) ; long timeoutAt = System . currentTimeMillis ( ) + 10000 ; while ( ( result . size ( ) < expectedMessages ) && ( System . currentTimeMillis ( ) < timeoutAt ) ) { for ( Record record : reader ) { result . add ( record ) ; } } return result ; }
Reads up to an expected number of messages from the stream, using the
  specified writer (which may have been used before), timing out after
  10 seconds.
Reads up to an expected number of messages from the stream using the specified writer ( which may have been used before ) timing out after 10 seconds .