 <p>You have to initialize collection before using it like i.e.</p> <pre><code>following=new ArrayList&lt;IntWritable&gt;(); </code></pre> <p>You just declare following and tweets but not initialized it. </p>