{
@Test
public void testGetAsObject()
{
Converter converter = new AtomicLongConverter();
assertNull(converter.getAsObject(null, null, null));
assertNull(converter.getAsObject(null, null, ""));
assertNull(converter.getAsObject(null, null, " "));
assertTrue(8 == ((AtomicLong) converter.getAsObject(null, null, " 8")).longValue());
assertTrue(8 == ((AtomicLong) converter.getAsObject(null, null, "8 ")).longValue());
assertTrue(8 == ((AtomicLong) converter.getAsObject(null, null, "8")).longValue());
long over = Long.MAX_VALUE + 1;
assertTrue(over == ((AtomicLong) converter.getAsObject(null, null, over + "")).longValue());
long under = Long.MIN_VALUE - 1;
assertTrue(under == ((AtomicLong) converter.getAsObject(null, null, under + "")).longValue());
try
{
converter.getAsObject(null, null, "NaN");
fail("should only take numbers");
}
catch (ConverterException c) { }
}