TableRepositoryImpl extends AbstractCRUDRepository<Table> implements TableRepository { @Override public boolean exists(Identifier identifier) { if (identifier == null || identifier.isEmpty()) { return false; } BoundStatement bs = new BoundStatement(existStmt); bindIdentifier(bs, identifier); return (getSession().execute(bs).one().getLong(0) > 0); } TableRepositoryImpl(Session session); @Override boolean exists(Identifier identifier); @Override Table read(Identifier identifier); @Override Table create(Table entity); @Override Table update(Table entity); @Override void delete(Table entity); @Override void delete(Identifier id); @Override List<Table> readAll(Identifier id); @Override List<Table> readAll(); @Override long countAllTables(String database); @Override long countTableSize(String database, String tableName);  }
@Test public void testExists() { System.out.println("exists"); Table testTable = Fixtures.createTestTable(); Identifier identifier = testTable.getId(); TableRepository instance = new TableRepositoryImpl(f.getSession()); boolean result = instance.exists(identifier); assertEquals(false, result); f.insertTable(testTable); result = instance.exists(identifier); assertEquals(true, result); }