### Question:
JpaColumnStorage implements ColumnStorage { @SuppressWarnings("unchecked") @Override public List<String> getAllColumnNames() { final Query query = persistenceManager.createQuery("select c.name from Column c"); 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 testGetAllColumnNames() { final String sql = "select c.name from Column c"; final List<String> columnNameList = new ArrayList<>(); columnNameList.add("Johanna"); columnNameList.add("Uwe"); final Query query = mock(Query.class); when(persistenceManager.createQuery(sql)).thenReturn(query); when(query.getResultList()).thenReturn(columnNameList); final List<String> namesFromStorage = columnStorage.getAllColumnNames(); assertNotNull(namesFromStorage); verify(persistenceManager, times(1)).createQuery(sql); verify(query, times(1)).getResultList(); verifyNoMoreInteractions(persistenceManager); verifyNoMoreInteractions(query); }