### Question:
PeerPermissions implements AutoCloseable { public void subscribeUpdate(final PermissionsUpdateCallback callback) { updateSubscribers.subscribe(callback); }  static PeerPermissions noop(); static PeerPermissions combine(final PeerPermissions... permissions); static PeerPermissions combine(final List<PeerPermissions> permissions); abstract boolean isPermitted(
      final Peer localNode, final Peer remotePeer, final Action action); @Override void close(); void subscribeUpdate(final PermissionsUpdateCallback callback); static final PeerPermissions NOOP; }### Answer:
@Test public void subscribeUpdate() { TestPeerPermissions peerPermissions = new TestPeerPermissions(false); final AtomicInteger callbackCount = new AtomicInteger(0); peerPermissions.subscribeUpdate( (permissionsRestricted, affectedPeers) -> callbackCount.incrementAndGet()); peerPermissions.allowPeers(true); assertThat(callbackCount).hasValue(1); peerPermissions.allowPeers(false); assertThat(callbackCount).hasValue(2); }