int asyncBackups(int requestedSyncBackups, int requestedAsyncBackups, boolean syncForced) {
        if (syncForced || requestedAsyncBackups == 0) {
            // if syncForced, then there will never be any async backups (they are forced to become sync)
            // if there are no asyncBackups then we are also done.
            return 0;
        }

        InternalPartitionService partitionService = node.getPartitionService();
        int maxBackupCount = partitionService.getMaxAllowedBackupCount();
        return min(maxBackupCount - requestedSyncBackups, requestedAsyncBackups);
    }
@Test
    public void asyncBackups_whenForceSyncDisabled() {
        setup(BACKPRESSURE_ENABLED);

        // when forceSync disabled, only the async matters
        assertEquals(0, backupHandler.asyncBackups(0, 0, FORCE_SYNC_DISABLED));
        assertEquals(1, backupHandler.asyncBackups(0, 1, FORCE_SYNC_DISABLED));
        assertEquals(0, backupHandler.asyncBackups(2, 0, FORCE_SYNC_DISABLED));
        assertEquals(1, backupHandler.asyncBackups(2, 1, FORCE_SYNC_DISABLED));

        // see what happens when we reach maximum number of backups
        assertEquals(BACKUPS, backupHandler.asyncBackups(0, BACKUPS + 1, FORCE_SYNC_DISABLED));
    }