public CompletableFuture<List<StatusCode>> deleteMonitoredItems(List<UaMonitoredItem> itemsToDelete) {
List<UInteger> monitoredItemIds = itemsToDelete.stream()
.map(UaMonitoredItem::getMonitoredItemId)
.collect(Collectors.toList());
return client.deleteMonitoredItems(subscriptionId, monitoredItemIds).thenApply(response -> {
<BUG>StatusCode[] results = response.getResults();
</BUG>
for (UaMonitoredItem item : itemsToDelete) {
itemsByClientHandle.remove(item.getClientHandle());
itemsByServerHandle.remove(item.getMonitoredItemId());

public CompletableFuture<List<StatusCode>> deleteMonitoredItems(List<UaMonitoredItem> itemsToDelete) {
List<UInteger> monitoredItemIds = itemsToDelete.stream()
.map(UaMonitoredItem::getMonitoredItemId)
.collect(Collectors.toList());
return client.deleteMonitoredItems(subscriptionId, monitoredItemIds).thenApply(response -> {
List<StatusCode> results = l(response.getResults());
for (UaMonitoredItem item : itemsToDelete) {
itemsByClientHandle.remove(item.getClientHandle());
itemsByServerHandle.remove(item.getMonitoredItemId());
