@Override public CompletableFuture<UaNode> createNode(NodeId nodeId) { ReadValueId readValueId = new ReadValueId( nodeId, AttributeId.NodeClass.uid(), null, QualifiedName.NULL_VALUE); CompletableFuture<ReadResponse> future = client.read(0.0, TimestampsToReturn.Neither, newArrayList(readValueId)); return future.thenCompose(response -> { DataValue value = l(response.getResults()).get(0); NodeClass nodeClass = NodeClass.from((Integer) value.getValue().getValue()); if (nodeClass != null) { client.getNodeCache().putAttribute(nodeId, AttributeId.NodeClass, value); return completedFuture(createNode(nodeId, nodeClass)); } else { return failedFuture(new UaException(value.getStatusCode(), "NodeClass was null")); } }); }