{
@Test
public void testGetAsObject()
{
Converter converter = new AtomicIntegerConverter();
assertNull(converter.getAsObject(null, null, null));
assertNull(converter.getAsObject(null, null, ""));
assertNull(converter.getAsObject(null, null, " "));
assertTrue(8 == ((AtomicInteger) converter.getAsObject(null, null, " 8")).intValue());
assertTrue(8 == ((AtomicInteger) converter.getAsObject(null, null, "8 ")).intValue());
assertTrue(8 == ((AtomicInteger) converter.getAsObject(null, null, "8")).intValue());
int over = Integer.MAX_VALUE + 1;
assertTrue(over == ((AtomicInteger) converter.getAsObject(null, null, over + "")).intValue());
int under = Integer.MIN_VALUE - 1;
assertTrue(under == ((AtomicInteger) converter.getAsObject(null, null, under + "")).intValue());
try
{
converter.getAsObject(null, null, "NaN");
fail("should only take numbers");
}
catch (ConverterException c) { }
}