### Question:
SchemaProducerImpl implements SchemaProducer { @Override public String schemaForDAO(Class<? extends CassandraDao> clazz, final Version version) { StringBuilder schema = new StringBuilder(); for (Version vers : versionsToApply(version)) { schema.append(loadDaoScripts(tablesOfDao.getTables(clazz), vers)); } return schema.toString(); } @Inject @VisibleForTesting  SchemaProducerImpl(DaoTables tablesOfDao); @Override SortedSet<Version> versionsAvailable(); @Override String lastSchema(); @Override String schema(Version version); @Override String lastSchemaForDAO(Class<? extends CassandraDao> clazz); @Override String schemaForDAO(Class<? extends CassandraDao> clazz, final Version version); @Override String schema(Version fromVersion, Version toVersion);  }### Answer:
@Test public void testSchemaForDAOVersion1() { String scripts = schemaProducerImpl.schemaForDAO(MonitoredCollectionDaoCassandraImpl.class, Version.of(1)); assertThat(scripts).isEqualTo( "CREATE TABLE monitored_collection (\n" + " credentials text,\n" + " device text,\n" + " analysed_sync_collections set<text>,\n" + " PRIMARY KEY (credentials, device)\n" + ");\n"); }
@Test public void testSchemaForDAOVersion2() { String scripts = schemaProducerImpl.schemaForDAO(MonitoredCollectionDaoCassandraImpl.class, Version.of(2)); assertThat(scripts).isEqualTo( "CREATE TABLE monitored_collection (\n" + " credentials text,\n" + " device text,\n" + " analysed_sync_collections set<text>,\n" + " PRIMARY KEY (credentials, device)\n" + ");\n" + "ALTER TABLE monitored_collection VERSION 2\n"); }
@Test public void testSchemaForDAOVersion3() { String scripts = schemaProducerImpl.schemaForDAO(MonitoredCollectionDaoCassandraImpl.class, Version.of(3)); assertThat(scripts).isEqualTo( "CREATE TABLE monitored_collection (\n" + " credentials text,\n" + " device text,\n" + " analysed_sync_collections set<text>,\n" + " PRIMARY KEY (credentials, device)\n" + ");\n" + "ALTER TABLE monitored_collection VERSION 2\n"); }