class ValLub { public void easyLub() { java.util.Map m = java.util.Collections.emptyMap(); final java.util.Map foo = (System.currentTimeMillis() > 0) ? m : java.util.Collections.emptyMap(); } public void sillyLubWithUnboxingThatProducesErrorThatVarIsPrimitive() { Integer i = 20; Double d = 20.0; final double thisShouldBePrimitiveDouble = (System.currentTimeMillis() > 0) ? i : d; } public void hardLub() { java.util.List list = new java.util.ArrayList(); java.util.Set set = new java.util.HashSet(); final java.util.Collection thisShouldBeCollection = (System.currentTimeMillis() > 0) ? list : set; thisShouldBeCollection.add(""); String foo = thisShouldBeCollection.iterator().next(); } }