@Test
public void testBootstrapResetNewServers()  // borrowed from similar V3 test
throws Exception
{

  List<String> sourceNames = new ArrayList<String>();
  final String firstSourceName = "com.linkedin.events.example.Person";
  final int firstSourceIndex = 0;
  sourceNames.add(firstSourceName);
  final String catchupSourceName = "com.linkedin.events.example.Place";
  final int catchupSourceIndex = 1;
  sourceNames.add(catchupSourceName);
  final String snapshotSourceName = "com.linkedin.events.example.Thing";
  final int snapshotSourceIndex = 2;
  sourceNames.add(snapshotSourceName);
  BootstrapCheckpointHandler ckptHandler = new BootstrapCheckpointHandler(sourceNames);
  final long targetScn = 129971;
  final long sinceScn = 0;
  final long windowOffset = 0;
  final long prevScn = -1;
  final long windowScn = 123456;
  final long startScn = 123456;
  final long snapshotOffset = -1;
  Checkpoint ckpt = new Checkpoint();
  ckpt.setConsumptionMode(DbusClientMode.BOOTSTRAP_SNAPSHOT);
  ckpt.setBootstrapStartScn(startScn);
  ckpt.setConsumptionMode(DbusClientMode.BOOTSTRAP_CATCHUP);
  ckpt.setBootstrapTargetScn(targetScn);
  ckpt.setBootstrapSinceScn(sinceScn);
  ckpt.setWindowOffset(windowOffset);  // must set after targetScn if CATCHUP
  ckpt.setPrevScn(prevScn);
  ckpt.setWindowScn(windowScn);
  ckpt.setSnapshotOffset(snapshotOffset);
  // no public setter for source names, so use introspection instead
  Class[] params = new Class[2];
  params[0] = Integer.TYPE;
  params[1] = String.class;
  Method setSnapshotSourceMethod = Checkpoint.class.getDeclaredMethod("setSnapshotSource", params);
  Method setCatchupSourceMethod  = Checkpoint.class.getDeclaredMethod("setCatchupSource", params);
  setSnapshotSourceMethod.setAccessible(true);
  setCatchupSourceMethod.setAccessible(true);
  setSnapshotSourceMethod.invoke(ckpt, snapshotSourceIndex, snapshotSourceName);
  setCatchupSourceMethod.invoke(ckpt, catchupSourceIndex, catchupSourceName);
  ckptHandler.resetForServerChange(ckpt);
  Assert.assertEquals(ckpt.getConsumptionMode(), DbusClientMode.BOOTSTRAP_SNAPSHOT);
  Assert.assertEquals(ckpt.getBootstrapSinceScn().longValue(), sinceScn);
  // TODO/FIXME:  for next three, check for exact values or just assertNotEquals against original values?
  Assert.assertEquals(ckpt.getBootstrapStartScn().longValue(), -1);
  Assert.assertEquals(ckpt.getBootstrapTargetScn().longValue(), -1);
  Assert.assertEquals(ckpt.getSnapshotOffset().longValue(), 0);
  // expect indices both reset to 0, and therefore, for consistency, names both reset to corresponding source name:
  Assert.assertEquals(ckpt.getBootstrapSnapshotSourceIndex().intValue(), firstSourceIndex);
  Assert.assertEquals(ckpt.getBootstrapCatchupSourceIndex().intValue(), firstSourceIndex);
  Assert.assertEquals(ckpt.getSnapshotSource(), firstSourceName);
  Assert.assertEquals(ckpt.getCatchupSource(), firstSourceName);
}