Root<Foo> foo = q.from(Foo.class);
q.multiselect(cb.construct(Foo.class, foo.get(Foo_.flong), foo.get(Foo_.fstring)),
cb.tuple(foo, cb.array(foo.get(Foo_.fint), cb.tuple(foo.get(Foo_.fstring)))));
List<Tuple> result = em.createQuery(q).getResultList();
assertFalse(result.isEmpty());
Tuple tuple = result.get(0);
assertEquals(Foo.class, tuple.get(0).getClass());
assertTrue(Tuple.class.isAssignableFrom(tuple.get(1).getClass()));
Tuple tuple2 = (Tuple)tuple.get(1);
assertEquals(Foo.class, tuple2.get(0).getClass());
assertEquals(Object[].class, tuple2.get(1).getClass());
Object[] level3 = (Object[])tuple2.get(1);
assertEquals(Integer.class, level3[0].getClass());
assertTrue(Tuple.class.isAssignableFrom(level3[1].getClass()));
Tuple tuple4 = (Tuple)level3[1];
assertEquals(String.class, tuple4.get(0).getClass());
}