static void testGetIdValue() { Account a = new Account { Name = "Acme" }; Soql.insert(a); JSONParse parser = new JSONParse("\"" + a.Id.ToString() + "\""); System.assertEquals(a.Id, parser.getIdValue()); try { parser = new JSONParse("[1,2,3]"); parser.getIdValue(); System.assert(false, "Node is not a valid Id, should have seen an exception about that."); } catch (JSONParse.InvalidConversionException e) { System.assertEquals("This value cannot be converted to an Id: [ 1, 2, 3 ]", e.getMessage()); } }