Program: 37622
Project: 37622
Buggy source:
@Test public void canCRUDSqlElasticPool() throws Exception {
  SqlServer sqlServer=createSqlServer();
  sqlServer=sqlServerManager.sqlServers().getByResourceGroup(RG_NAME,SQL_SERVER_NAME);
  validateSqlServer(sqlServer);
  Observable<Indexable> resourceStream=sqlServer.elasticPools().define(SQL_ELASTIC_POOL_NAME).withEdition(ElasticPoolEditions.STANDARD).createAsync();
  SqlElasticPool sqlElasticPool=Utils.<SqlElasticPool>rootResource(resourceStream).toBlocking().first();
  validateSqlElasticPool(sqlElasticPool);
  Assert.assertEquals(sqlElasticPool.listDatabases().size(),0);
  sqlElasticPool=sqlElasticPool.update().withDtu(100).withDatabaseDtuMax(20).withDatabaseDtuMin(10).withStorageCapacity(102400).withNewDatabase(SQL_DATABASE_NAME).apply();
  validateSqlElasticPool(sqlElasticPool);
  Assert.assertEquals(sqlElasticPool.listDatabases().size(),1);
  validateSqlElasticPool(sqlServer.elasticPools().get(SQL_ELASTIC_POOL_NAME));
  validateListSqlElasticPool(sqlServer.elasticPools().list());
  sqlServer.databases().delete(SQL_DATABASE_NAME);
  sqlServer.elasticPools().delete(SQL_ELASTIC_POOL_NAME);
  validateSqlElasticPoolNotFound(sqlServer,SQL_ELASTIC_POOL_NAME);
  resourceStream=sqlServer.elasticPools().define("String_Node_Str").withEdition(ElasticPoolEditions.STANDARD).createAsync();
  sqlElasticPool=Utils.<SqlElasticPool>rootResource(resourceStream).toBlocking().first();
  sqlServer.elasticPools().delete(sqlElasticPool.name());
  validateSqlElasticPoolNotFound(sqlServer,"String_Node_Str");
  sqlServerManager.sqlServers().deleteByResourceGroup(sqlServer.resourceGroupName(),sqlServer.name());
  validateSqlServerNotFound(sqlServer);
}

Fixed version (ground truth):
@Test public void canCRUDSqlElasticPool() throws Exception {
  SqlServer sqlServer=createSqlServer();
  sqlServer=sqlServerManager.sqlServers().getByResourceGroup(RG_NAME,SQL_SERVER_NAME);
  validateSqlServer(sqlServer);
  Observable<Indexable> resourceStream=sqlServer.elasticPools().define(SQL_ELASTIC_POOL_NAME).withEdition(ElasticPoolEditions.STANDARD).withTag("String_Node_Str","String_Node_Str").createAsync();
  SqlElasticPool sqlElasticPool=Utils.<SqlElasticPool>rootResource(resourceStream).toBlocking().first();
  validateSqlElasticPool(sqlElasticPool);
  Assert.assertEquals(sqlElasticPool.listDatabases().size(),0);
  sqlElasticPool=sqlElasticPool.update().withDtu(100).withDatabaseDtuMax(20).withDatabaseDtuMin(10).withStorageCapacity(102400).withNewDatabase(SQL_DATABASE_NAME).withTag("String_Node_Str","String_Node_Str").apply();
  validateSqlElasticPool(sqlElasticPool);
  Assert.assertEquals(sqlElasticPool.listDatabases().size(),1);
  validateSqlElasticPool(sqlServer.elasticPools().get(SQL_ELASTIC_POOL_NAME));
  validateListSqlElasticPool(sqlServer.elasticPools().list());
  sqlServer.databases().delete(SQL_DATABASE_NAME);
  sqlServer.elasticPools().delete(SQL_ELASTIC_POOL_NAME);
  validateSqlElasticPoolNotFound(sqlServer,SQL_ELASTIC_POOL_NAME);
  resourceStream=sqlServer.elasticPools().define("String_Node_Str").withEdition(ElasticPoolEditions.STANDARD).createAsync();
  sqlElasticPool=Utils.<SqlElasticPool>rootResource(resourceStream).toBlocking().first();
  sqlServer.elasticPools().delete(sqlElasticPool.name());
  validateSqlElasticPoolNotFound(sqlServer,"String_Node_Str");
  sqlServerManager.sqlServers().deleteByResourceGroup(sqlServer.resourceGroupName(),sqlServer.name());
  validateSqlServerNotFound(sqlServer);
}