@Test
public void testRefreshEntries()
    throws UnsupportedOperationException, IOException {

  // Initial table loaded
  testDestination();
  assertEquals(10, mountTable.getMounts("/").size());
  // Replace table with /1 and /2
  List<MountTable> records = new ArrayList<>();
  Map<String, String> map1 = getMountTableEntry("1", "/");
  records.add(MountTable.newInstance("/1", map1));
  Map<String, String> map2 = getMountTableEntry("2", "/");
  records.add(MountTable.newInstance("/2", map2));
  mountTable.refreshEntries(records);
  // Verify addition
  PathLocation destination1 = mountTable.getDestinationForPath("/1");
  RemoteLocation defaultLoc1 = destination1.getDefaultLocation();
  assertEquals("1", defaultLoc1.getNameserviceId());
  PathLocation destination2 = mountTable.getDestinationForPath("/2");
  RemoteLocation defaultLoc2 = destination2.getDefaultLocation();
  assertEquals("2", defaultLoc2.getNameserviceId());
  // Verify existing entries were removed
  assertEquals(2, mountTable.getMounts("/").size());
  boolean assertionThrown = false;
  try {
    testDestination();
    fail();
  } catch (AssertionError e) {
    // The / entry was removed, so it triggers an exception
    assertionThrown = true;
  }
  assertTrue(assertionThrown);
}