### Question:
JpaColumnStorage implements ColumnStorage { @SuppressWarnings("unchecked") @Override public List<Item> getAllColumns() { final Query query = persistenceManager.createQuery("select c from Column c order by c.name"); return query.getResultList(); } JpaColumnStorage(PersistenceManager persistenceManager); @Override Column getColumn(String columnName); @SuppressWarnings("unchecked") @Override List<Item> getAllColumns(); @Override List<Item> getAllColumnsWithTransaction(); @SuppressWarnings("unchecked") @Override List<String> getAllColumnNames(); @Override List<String> getAllColumnNamesWithTransaction(); void store(Column column); @Override void storeWithTransaction(Column column); @Override void deleteAll();  }### Answer:
@Test public void testGetAllColumns() { final String sql = "select c from Column c order by c.name"; final List<Column> columnList = new ArrayList<>(); columnList.add((Column) new ColumnBuilder().name("test_me").build()); final Query query = mock(Query.class); when(persistenceManager.createQuery(sql)).thenReturn(query); when(query.getResultList()).thenReturn(columnList); final List<? extends Item> allColumns = columnStorage.getAllColumns(); assertNotNull(allColumns); assertEquals(1, allColumns.size()); assertEquals("test_me", allColumns.get(0).getName()); verify(persistenceManager, times(1)).createQuery(sql); verifyNoMoreInteractions(persistenceManager); verify(query, times(1)).getResultList(); verifyNoMoreInteractions(query); }