@Override
    public CompletableFuture<Void> relinquishMastership(DeviceId deviceId) {
        return store.relinquishRole(networkId, localNodeId, deviceId)
                .thenAccept(this::post)
                .thenApply(v -> null);
    }
@Test
    public void relinquishMastership() {
        //no backups - should just turn to NONE for device.
        mastershipMgr1.setRole(NID_LOCAL, VDID1, MASTER);
        assertEquals("wrong role:", MASTER, mastershipMgr1.getLocalRole(VDID1));
        mastershipMgr1.relinquishMastership(VDID1);
        assertNull("wrong master:", mastershipMgr1.getMasterFor(VDID2));
        assertEquals("wrong role:", NONE, mastershipMgr1.getLocalRole(VDID1));

        //not master, nothing should happen
        mastershipMgr1.setRole(NID_LOCAL, VDID2, NONE);
        mastershipMgr1.relinquishMastership(VDID2);
        assertNull("wrong role:", mastershipMgr1.getMasterFor(VDID2));

        //provide NID_OTHER as backup and relinquish
        mastershipMgr1.setRole(NID_LOCAL, VDID1, MASTER);
        assertEquals("wrong master:", NID_LOCAL, mastershipMgr1.getMasterFor(VDID1));
        mastershipMgr1.setRole(NID_OTHER, VDID1, STANDBY);
        mastershipMgr1.relinquishMastership(VDID1);
        assertEquals("wrong master:", NID_OTHER, mastershipMgr1.getMasterFor(VDID1));
    }