Code review comment: Yeah, this test is flaky the way it's written, but we also can't just comment out the assertion since that defeats the purpose of the test.  Looking through this file, it looks like we're already creating and deleting a pool for every other test. Can we get rid of the `@BeforeClass` and `@AfterClass` functions? I don't see why we have a static variable livePool at all.  If we then create a pool inside `testPoolOData`, we can just assert that the expected pool exists in the list. Then there's no issue with other test pools existing. As far as I can see this won't affect test performance at all, because we'd be removing one pool create call and adding one.

Code under review:
public void testPoolOData() throws Exception {
        CloudPool pool = batchClient.poolOperations().getPool(poolId,
                new DetailLevel.Builder().withExpandClause("stats").build());

        
        
        

        List<CloudPool> pools = batchClient.poolOperations()
                .listPools(new DetailLevel.Builder().withSelectClause("id, state").build());
        Assert.assertTrue(pools.size() > 0);
        Assert.assertNotNull(pools.get(0).id());
        Assert.assertNull(pools.get(0).vmSize());

        
        pools = batchClient.poolOperations()
                .listPools(new DetailLevel.Builder().withFilterClause("state eq 'deleting'").build());
        

    }


Revised code:
public void testPoolOData() throws Exception {
        String poolId = getStringIdWithUserNamePrefix("-testPoolOData");

        
        String POOL_VM_SIZE = "STANDARD_D1_V2";
        int POOL_VM_COUNT = 2;
        int POOL_LOW_PRI_VM_COUNT = 2;

        
        if (!batchClient.poolOperations().existsPool(poolId)) {
            ImageReference imgRef = new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer")
                    .withSku("18.04-LTS").withVersion("latest");
            VirtualMachineConfiguration configuration = new VirtualMachineConfiguration();
            configuration.withNodeAgentSKUId("batch.node.ubuntu 18.04").withImageReference(imgRef);

            NetworkConfiguration netConfig = createNetworkConfiguration();
            PoolEndpointConfiguration endpointConfig = new PoolEndpointConfiguration();
            List<InboundNATPool> inbounds = new ArrayList<>();
            inbounds.add(new InboundNATPool().withName("testinbound").withProtocol(InboundEndpointProtocol.TCP)
                    .withBackendPort(5000).withFrontendPortRangeStart(60000).withFrontendPortRangeEnd(60040));
            endpointConfig.withInboundNATPools(inbounds);
            netConfig.withEndpointConfiguration(endpointConfig).withEnableAcceleratedNetworking(true);

            PoolAddParameter addParameter = new PoolAddParameter().withId(poolId)
                    .withTargetDedicatedNodes(POOL_VM_COUNT).withTargetLowPriorityNodes(POOL_LOW_PRI_VM_COUNT)
                    .withVmSize(POOL_VM_SIZE).withVirtualMachineConfiguration(configuration)
                    .withNetworkConfiguration(netConfig)
                    .withTargetNodeCommunicationMode(NodeCommunicationMode.DEFAULT);
            batchClient.poolOperations().createPool(addParameter);
        }
        Assert.assertTrue(batchClient.poolOperations().existsPool(poolId));

        try {
            List<CloudPool> pools = batchClient.poolOperations()
                .listPools(new DetailLevel.Builder().withSelectClause("id, state").build());
            Assert.assertTrue(pools.size() > 0);
            Assert.assertNotNull(pools.get(0).id());
            Assert.assertNull(pools.get(0).vmSize());
        } finally {
            try {
                if (batchClient.poolOperations().existsPool(poolId)) {
                    batchClient.poolOperations().deletePool(poolId);
                }
            } catch (Exception e) {
                
            }
        }
    }