class NetworkSamplesGenerator {

    public NetworkSamples generate(final int totalSampleCount) {
        Preconditions.checkArgument(dropCount < totalSampleCount,
            "Cannot drop more samples than requested or all of the samples. Samples requested %s and dropping %s",
            totalSampleCount, dropCount
        );

        StatusBar statusBar = statusBarSupplier.get();

        Map<VariableReference, List<?>> samplesByVariable = new HashMap<>();
        List<Double> logOfMasterPForEachSample = new ArrayList<>();

        dropSamples(dropCount, statusBar);

        PercentageComponent statusPercentage = newPercentageComponentAndAddToStatusBar(statusBar);
        RemainingTimeComponent remainingTimeComponent = new RemainingTimeComponent(totalSampleCount);
        statusBar.addComponent(remainingTimeComponent);
        statusBar.setMessage("Sampling...");
        int sampleCount = 0;
        int samplesLeft = totalSampleCount - dropCount;
        for (int i = 0; i < samplesLeft; i++) {
            if (i % downSampleInterval == 0) {
                algorithm.sample(samplesByVariable, logOfMasterPForEachSample);
                sampleCount++;
            } else {
                algorithm.step();
            }
            remainingTimeComponent.step();
            statusPercentage.progress((double) (i + 1) / samplesLeft);
        }

        statusBar.finish();
        return new NetworkSamples(samplesByVariable, logOfMasterPForEachSample, sampleCount);
    }

    public  NetworkSamplesGenerator(SamplingAlgorithm algorithm, Supplier<StatusBar> statusBarSupplier);

}