MinMaxElementsValidation performs a useful role as a template for
how we can create simple subtree validations. Split the common bits
into AbstractValidation and elinate code duplication by doing some
trickery.
JIRA: YANGTOOLS-1177
Change-Id: I5adbed16e85f9752a0ce5061b0159c8124583346
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ffe8f4ea13bd2bab97514aa1d6ee257a1d7b39ff)