@Override
    public CompletableFuture<PlcReadResponse> read(PlcReadRequest readRequest) {
        Map<String, PlcResponseItem<PlcValue>> tags = new HashMap<>();
        for (String tagName : readRequest.getTagNames()) {
            SimulatedTag tag = (SimulatedTag) readRequest.getTag(tagName);
            Optional<PlcValue> valueOptional = device.get(tag);
            PlcResponseItem<PlcValue> tagPair;
            boolean present = valueOptional.isPresent();
            tagPair = present
                ? new DefaultPlcResponseItem<>(PlcResponseCode.OK, valueOptional.get())
                : new DefaultPlcResponseItem<>(PlcResponseCode.NOT_FOUND, null);
            tags.put(tagName, tagPair);
        }
        PlcReadResponse response = new DefaultPlcReadResponse(readRequest, tags);
        return CompletableFuture.completedFuture(response);
    }
Connection to a test device.
This class is not thread-safe.
plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedConnection.java