### Question:
CassandraSchemaHandler { public boolean schemaExists(Cluster cluster, String schemaName) throws Exception { log.debug("Searching schema %s on cluster %s", schemaName, cluster); KeyspaceManager keyspaceManager = Pelops.createKeyspaceManager(cluster); try { KsDef ksDef = keyspaceManager.getKeyspaceSchema(schemaName); if (ksDef != null) { log.debug("Found schema %s", schemaName); return true; } } catch (TTransportException te) { log.error("It looks like the Cassandra Server is down"); log.error(te.getMessage(), te); throw te; } catch (NotFoundException nfe) { log.debug("Schema %s does not exist", schemaName); } catch (org.apache.cassandra.thrift.NotFoundException nfe2) { log.debug("Schema %s does not exist", schemaName); } catch (Exception e) { log.error("There has been an error: " + e.getMessage()); } return false; }  boolean schemaExists(Cluster cluster, String schemaName); boolean validSchema(Cluster cluster, String schemaName); void buildSchema(Cluster cluster, String schemaName); void buildSchema(Cluster cluster, String schemaName, boolean dropExisting); void dropSchema(String schemaName, KeyspaceManager keyspaceManager); void setSchemaWaitPeriod(int schemaWaitPeriod); void setWaitForSyncing(boolean waitForSyncing);  }### Answer:
@Test public void testSchemaDoesNotExist() throws Exception { CassandraSchemaHandler schemaHandler = new CassandraSchemaHandler(); Cluster cluster = new Cluster("localhost", Integer.parseInt(CassandraDatastoreTest.CASSANDRA_TESTING_PORT), false); assertFalse(schemaHandler.schemaExists(cluster, "rayo")); }
@Test public void testSchemaExists() throws Exception { CassandraSchemaHandler schemaHandler = new CassandraSchemaHandler(); Cluster cluster = new Cluster("localhost", Integer.parseInt(CassandraDatastoreTest.CASSANDRA_TESTING_PORT), false); schemaHandler.buildSchema(cluster, "rayo"); assertTrue(schemaHandler.schemaExists(cluster, "rayo")); }