gt:         List<Author> results = query.executeAndClose(sourceTest);
context: package name.gerardmundo.jdrql.integration;
  
  import java.lang.reflect.InvocationTargetException;
  import java.math.BigDecimal;
  import java.sql.Timestamp;
  import java.util.Collection;
  import java.util.HashMap;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import name.gerardmundo.jdrql.Query;
  import name.gerardmundo.jdrql.integration.datastructures.Author;
  import name.gerardmundo.jdrql.integration.datastructures.Publication;
  
  import com.akiban.sql.StandardException;
  
  @SuppressWarnings("all")
  public class MapResultTest extends TestCase {
      
      /**
       * Create the test case
       * 
       * @param testName
       *            name of the test case
       */
      public MapResultTest(String testName) {
      
          super(testName);
          
          sourceTest = new LinkedList<Author>();
          
          sourceTest.add(new Author(55, "Aitor Tilla", new Timestamp(3000)));
          sourceTest.add(new Author(67, "John Smith", new Timestamp(99999999)));
          sourceTest.add(new Author(853, "Burack Johnson", null));
          
          sourceTestPublication = new LinkedList<Publication>();
          
          sourceTestPublication.add(new Publication(55, "Aitor Tilla", 1989, null, null, null, null));
          sourceTestPublication.add(new Publication(67, "John Smith", 2001, null, null, null, null));
          sourceTestPublication.add(new Publication(853, "Burack Johnson", 2014, null, null, null,
                  null));
      }
      
      /**
       * @return the suite of tests being tested
       */
      public static Test suite() {
      
          return new TestSuite(MapResultTest.class);
      }
      
      private Collection<Author>      sourceTest;
      
      private Collection<Publication> sourceTestPublication;
      
      private static String           queryString              = "SELECT id, name FROM author";
      private static String           queryStringTableAsterisk = "SELECT author.* FROM author";
      private static String           queryStringAsterisk      = "SELECT * FROM author";
      
      private void checkMap(List<Map<String, Object>> results) {
      
          assertEquals(3, results.size());
          boolean found55 = false;
          boolean found67 = false;
          boolean found853 = false;
          for (Map<String, Object> result : results) {
              assertEquals(2, result.size());
              switch (((BigDecimal) result.get("id")).intValue()) {
                  case 55:
                      assertEquals("Aitor Tilla", result.get("name"));
                      found55 = true;
                  break;
                  case 67:
                      assertEquals("John Smith", result.get("name"));
                      found67 = true;
                  break;
                  case 853:
                      assertEquals("Burack Johnson", result.get("name"));
                      found853 = true;
                  break;
                  default:
                      fail("Unexpected object found");
              }
          }
          assertTrue(found55);
          assertTrue(found67);
          assertTrue(found853);
      }
      
      private void checkMapTableAsterisk(List<Map<String, Object>> results) {
      
          assertEquals(3, results.size());
          boolean found55 = false;
          boolean found67 = false;
          boolean found853 = false;
          for (Map<String, Object> result : results) {
              assertEquals(3, result.size());
              switch (((BigDecimal) result.get("id")).intValue()) {
                  case 55:
                      assertEquals("Aitor Tilla", result.get("name"));
                      assertEquals(new Timestamp(3000), result.get("dateofbirth"));
                      found55 = true;
                  break;
                  case 67:
                      assertEquals("John Smith", result.get("name"));
                      assertEquals(new Timestamp(99999999), result.get("dateofbirth"));
                      found67 = true;
                  break;
                  case 853:
                      assertEquals("Burack Johnson", result.get("name"));
                      assertNull(result.get("dateofbirth"));
                      found853 = true;
                  break;
                  default:
                      fail("Unexpected object found");
              }
          }
          assertTrue(found55);
          assertTrue(found67);
          assertTrue(found853);
      }
      
      private void checkCustom(List<Author> results) {
      
          assertEquals(3, results.size());
          boolean found55 = false;
          boolean found67 = false;
          boolean found853 = false;
          for (Author result : results) {
              assertNull(result.getDateOfBirth());
              switch (result.getId()) {
                  case 55:
                      assertEquals("Aitor Tilla", result.getName());
                      found55 = true;
                  break;
                  case 67:
                      assertEquals("John Smith", result.getName());
                      found67 = true;
                  break;
                  case 853:
                      assertEquals("Burack Johnson", result.getName());
                      found853 = true;
                  break;
                  default:
                      fail("Unexpected object found");
              }
          }
          assertTrue(found55);
          assertTrue(found67);
          assertTrue(found853);
      }
      
      private void checkCustomTableAsterisk(List<Author> results) {
      
          assertEquals(3, results.size());
          boolean found55 = false;
          boolean found67 = false;
          boolean found853 = false;
          for (Author result : results) {
              switch (result.getId()) {
                  case 55:
                      assertEquals("Aitor Tilla", result.getName());
                      assertEquals(new Timestamp(3000), result.getDateOfBirth());
                      found55 = true;
                  break;
                  case 67:
                      assertEquals("John Smith", result.getName());
                      assertEquals(new Timestamp(99999999), result.getDateOfBirth());
                      found67 = true;
                  break;
                  case 853:
                      assertEquals("Burack Johnson", result.getName());
                      assertNull(result.getDateOfBirth());
                      found853 = true;
                  break;
                  default:
                      fail("Unexpected object found");
              }
          }
          assertTrue(found55);
          assertTrue(found67);
          assertTrue(found853);
      }
      
      public void testNormal() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testNormalTableAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Map.class, Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testNormalAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Map.class, Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testCustomOverrideMap() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testCustomOverrideMapTableAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Author.class, Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testCustomOverrideMapAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Author.class, Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testCustomOverrideMapUnOverride() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, ClassNotFoundException,
              IllegalArgumentException, InvocationTargetException, StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setDestinationClass(Map.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustom(results);
      }
      
      public void testCustomOverrideMapUnOverrideTableAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Author.class, Author.class);
          query.setDestinationClass(Map.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustomTableAsterisk(results);
      }
      
      public void testCustomOverrideMapUnOverrideAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Author.class, Author.class);
          query.setDestinationClass(Map.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustomTableAsterisk(results);
      }
      
      public void testMapOverrideCustom() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustom(results);
      }
      
      public void testMapOverrideCustomTableAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Map.class, Author.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustomTableAsterisk(results);
      }
      
      public void testMapOverrideCustomAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Map.class, Author.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustomTableAsterisk(results);
      }
      
      public void testMapOverrideCustomUnoverride() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setDestinationClass(Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testMapOverrideCustomUnoverrideTableAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Map.class, Author.class);
          query.setDestinationClass(Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideCustomUnoverrideAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              ClassNotFoundException, IllegalArgumentException, InvocationTargetException,
              StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Map.class, Author.class);
          query.setDestinationClass(Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideMap() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testMapOverrideMapTableAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Map.class, Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideMapAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, ClassNotFoundException,
              IllegalArgumentException, InvocationTargetException, StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Map.class, Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testHashMap() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, HashMap.class, Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testHashMapTableAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, HashMap.class, Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testHashMapAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringAsterisk, HashMap.class, Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideSource() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Publication.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testMapOverrideSourceTableAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Map.class, Publication.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideSourceAsterisk() throws NoSuchMethodException, SecurityException,
              InstantiationException, IllegalAccessException, IllegalArgumentException,
              InvocationTargetException, ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Map.class, Publication.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideSourceUnOverrideSource() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testMapOverrideSourceUnOverrideSourceTableAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringTableAsterisk, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideSourceUnOverrideSourceAsterisk() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryStringAsterisk, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMapTableAsterisk(results);
      }
      
      public void testMapOverrideSourceOverrideCustom() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTestPublication);
          
          checkCustom(results);
      }
      
      public void testMapOverrideSourceOverrideCustomUnOverrideCustom() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTestPublication);
          
          checkMap(results);
      }
      
      public void testMapOverrideSourceOverrideCustomUnOverrideSource() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Author.class);
          query.setSourceClasses(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustom(results);
      }
      
      public void testMapOverrideSourceOverrideCustomUnOverrideCustomUnOverrideSource()
              throws NoSuchMethodException, SecurityException, InstantiationException,
              IllegalAccessException, IllegalArgumentException, InvocationTargetException,
              ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Author.class);
          query.setDestinationClass(Map.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testMapOverrideSourceOverrideCustomUnOverrideSourceUnOverrideCustom()
              throws NoSuchMethodException, SecurityException, InstantiationException,
              IllegalAccessException, IllegalArgumentException, InvocationTargetException,
              ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Map.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Author.class);
          query.setSourceClasses(Author.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testCustomOverrideSourceOverrideMap() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Map.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTestPublication);
          
          checkMap(results);
      }
      
      public void testCustomOverrideSourceOverrideMapUnOverrideMap() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Map.class);
          query.setDestinationClass(Author.class);
          List<Author> results = query.executeAndClose(sourceTestPublication);
          
          checkCustom(results);
      }
      
      public void testCustomOverrideSourceOverrideMapUnOverrideSource() throws NoSuchMethodException,
              SecurityException, InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, ClassNotFoundException,
              StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Map.class);
          query.setSourceClasses(Author.class);
          List<Map<String, Object>> results = query.executeAndClose(sourceTest);
          
          checkMap(results);
      }
      
      public void testCustomOverrideSourceOverrideMapUnOverrideMapUnOverrideSource()
              throws NoSuchMethodException, SecurityException, InstantiationException,
              IllegalAccessException, IllegalArgumentException, InvocationTargetException,
              ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Map.class);
          query.setDestinationClass(Author.class);
          query.setSourceClasses(Author.class);
          List<Author> results = query.executeAndClose(sourceTest);
          
          checkCustom(results);
      }
      
      public void testCustomOverrideSourceOverrideMapUnOverrideSourceUnOverrideMap()
              throws NoSuchMethodException, SecurityException, InstantiationException,
              IllegalAccessException, IllegalArgumentException, InvocationTargetException,
              ClassNotFoundException, StandardException {
      
          Query query = Query.parse(queryString, Author.class, Author.class);
          query.setSourceClasses(Publication.class);
          query.setDestinationClass(Map.class);
          query.setSourceClasses(Author.class);
          query.setDestinationClass(Author.class);
  