for (int fetchNum = 0; version.getVersion() != lastVersion.getVersion(); fetchNum++) {
Console.print(" getting deltas from version " + version.getVersion() + " ...");
final List<byte[]> deltas = Lists.newArrayList();
final AtomicReference<byte[]> targetVersion = new AtomicReference<byte[]>();
api.exportRawDeltas(waveId, waveletId,
version.toByteArray(), lastVersion.toByteArray(), rpcServerUrl, new RawDeltasListener() {
@Override
public void onSuccess(List<byte[]> rawDeltas, byte[] rawTargetVersion) {
deltas.addAll(rawDeltas);
targetVersion.set(rawTargetVersion);
}