title: Tool for validating generics in Java <1.5
body: <p>Is there a tool that would allow me to check use of generic collections in code that must be compilable with Java 1.4? I would imagine example code as:</p>
  
  <pre><code>Map/*&lt;String, Integer&gt;*/ map = new HashMap();
  map.put("abc", new Integer(3));  // ok
  map.put("def", "ghi");  // warning
  </code></pre>
  
  <p>EDIT: Unfortunately the build process is "set in stone" to use Java 1.4, so the code I commit cannot contain any 1.5 features, or depend on any translation tools. The easiest solution so far seems to be maintaining local version of code for 1.5, and converting it to 1.4 before commit.</p>