Math.abs(Integer) not working, can't convert Integer to int
<p>I'm implementing a Comparator that sorts based on absolute value. All I (think) I need is this single line of code:</p>

<pre><code>public int compare(Integer int1, Integer int2) {
    return Math.abs(int1).compareTo(Math.abs(int2));
}
</code></pre>

<p>The error: <code>'no suitable method found for abs(Integer)</code>'</p>

<p>I thought that Java unboxes the Integer object to int?</p>

<p>I tried pulling the int value from the two Integer objects using .intValue(), but that didn't work either. What am I doing wrong?</p>