@Test
    void node_distribution_key_outside_legal_range_is_disallowed() {
        // Only [0, UINT16_MAX - 1] is a valid range. UINT16_MAX is a special content layer-internal
        // sentinel value that must never be used by actual nodes.
        for (int distKey : List.of(-1, 65535, 65536, 100000)) {
            assertThrows(IllegalArgumentException.class, () ->
                    parse("""
                            <content version="1.0" id="storage">
                              <documents/>
                              <redundancy>1</redundancy>
                              <group>
                                <node hostalias='mockhost' distribution-key='%d' />
                              </group>
                            </content>""".formatted(distKey)
                        ));
        }
    }
Here there is no good choice.
config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java