class MaxMerger extends AbstractElementMerger {

    @Override
    public void mergeNodes(List<Node> fromParents, Element toParent, Document toDocument) throws PDUStitchingException {
        double maxValue = Double.NEGATIVE_INFINITY;
        for (Node fromParent : fromParents) {
            final double value = Double.parseDouble(fromParent.getTextContent());
            if (value > maxValue) {
                maxValue = value;
            }
        }
        addTextToNode(toParent, "" + maxValue, toDocument);
    }

}