Code example for ArrayList

Methods: add

0
        assertEquals(-1, info.getMessageId()); 
 
        info.getOffset().set(999); 
        info.setMessageId(100); 
        info.setModified(true); 
        final Collection<TopicPartitionRegInfo> infoList = new ArrayList<TopicPartitionRegInfo>(); 
        infoList.add(info); 
        this.offsetStorage.commitOffset(group, infoList); 
 
        final TopicPartitionRegInfo newInfo = this.offsetStorage.load(topic, group, partition); 
        assertEquals(topic, newInfo.getTopic()); 
        assertEquals(partition, newInfo.getPartition()); 
        assertEquals(999, newInfo.getOffset().get()); 
        assertEquals(100, info.getMessageId()); 
    } 
 
 
    @Test 
    public void initDuplicate() { 
        final String topic = "test"; 
        final String group = "test-grp";