### Question:
HibernateUtil { public static void clear() { Session session = openNewSession(); SQLQuery query = session.createSQLQuery("TRUNCATE SCHEMA public AND COMMIT"); query.executeUpdate(); session.close(); }  static synchronized SessionFactory getSessionFactory(); static Session openNewSession(); static void store(Object entity); static void delete(Object entity); static void update(Object entity); static Object retrieve(Class<?> clazz, Serializable id); static List<?> executeNamedQuery(String queryName); static List<?> queryCriteria(Class<?> persistentClass, Criterion... criterionArray); static void shutdown(); static void clear();  }### Answer:
@Test public void testClear() throws EntityStorageException { HibernateUtil.clear(); long expectedAlgorithmId = 0; Algorithm expectedAlgorithm = new Algorithm("some file"); expectedAlgorithm.setId(0); HibernateUtil.store(expectedAlgorithm); HibernateUtil.clear(); Algorithm actualAlgorithm = (Algorithm) HibernateUtil.retrieve(Algorithm.class, expectedAlgorithmId); assertNull(actualAlgorithm); HibernateUtil.clear(); }