final PreparedStatement ps = connection.prepareStatement("SELECT tmp.array_function();");
final ResultSet rs = ps.executeQuery();
final TypeMapper<?> mapper = TypeMapperFactory.createTypeMapper(ArrayResult.class);
int i = 0;
while (rs.next()) {
final ArrayResult result = (ArrayResult) mapper.mapRow(rs, i++);
Assert.assertEquals(0, result.getId().intValue());
Assert.assertEquals("result_code", result.getMsg());
Assert.assertNotNull(result.getMovies());
Assert.assertEquals(3, result.getMovies().size());
Assert.assertEquals(1, result.getMovies().get(0).getI());
Assert.assertEquals(2, result.getMovies().get(0).getL());
Assert.assertEquals("Daniel", result.getMovies().get(0).getC());
Assert.assertEquals(2, result.getMovies().get(1).getI());
Assert.assertEquals(3, result.getMovies().get(1).getL());
Assert.assertEquals("alone at", result.getMovies().get(1).getC());
Assert.assertEquals(3, result.getMovies().get(2).getI());
Assert.assertEquals(4, result.getMovies().get(2).getL());
Assert.assertEquals("home", result.getMovies().get(2).getC());
}
}