### Question:
HibernateHandler implements QueryHandler { @SuppressWarnings("deprecation") @Override public boolean transform(Query query, FactoryExpression<?> projection) { try { ResultTransformer transformer = new FactoryExpressionTransformer(projection); query.unwrap(org.hibernate.query.Query.class).setResultTransformer(transformer); return true; } catch (PersistenceException e) { return false; } }  @Override void addEntity(Query query, String alias, Class<?> type); @Override void addScalar(Query query, String alias, Class<?> type); @Override boolean createNativeQueryTyped(); @SuppressWarnings("unchecked") @Override CloseableIterator<T> iterate(Query query, FactoryExpression<?> projection); @SuppressWarnings("deprecation") @Override boolean transform(Query query, FactoryExpression<?> projection); @Override boolean wrapEntityProjections();  }### Answer:
@Test public void should_transform() { FactoryExpression<?> projection = createMock(FactoryExpression.class); expect(nativeQuery.unwrap(org.hibernate.query.Query.class)).andReturn(nativeQuery); expect(nativeQuery.setResultTransformer(anyObject(ResultTransformer.class))).andReturn(nativeQuery); replay(nativeQuery); assertTrue(hibernateHandler.transform(nativeQuery, projection)); }