<p>Since the introduction of generics in Java 5, it is recommenced to use generic types such as <code>List&lt;String&gt;</code> instead of raw ones such as just <code>List</code>. Assigning a raw type into a generic one is not type safe, and will generate a warning. The old <code>EMPTY_...</code> fields of the <code>Collections</code> class return raw types, whereas the newer <code>empty...()</code> methods return generic ones.</p>

Developers will also more easily find the <code>emptyIterator()</code> and <code>emptyListIterator()</code> methods for which there is no field equivalent if they are used to call the methods.

<h2>Noncompliant Code Example</h2>
<pre>
List&lt;String&gt; collection1 = Collections.EMPTY_LIST;
Map&lt;String, String&gt; collection2 = Collections.EMPTY_MAP;
Set&lt;String&gt; collection3 = Collections.EMPTY_SET;
</pre>

<h2>Compliant Solution</h2>
<pre>
List&lt;String&gt; collection1 = Collections.emptyList();
Map&lt;String, String&gt; collection2 = Collections.emptyMap();
Set&lt;String&gt; collection3 = Collections.emptySet();
</pre>