@Test
    public void testFromToMap() {
        SupportedVersionRange versionRange = new SupportedVersionRange((short) 1, (short) 2);
        assertEquals(1, versionRange.min());
        assertEquals(2, versionRange.max());

        Map<String, Short> versionRangeMap = versionRange.toMap();
        assertEquals(
            mkMap(mkEntry("min_version", versionRange.min()), mkEntry("max_version", versionRange.max())),
            versionRangeMap);

        SupportedVersionRange newVersionRange = SupportedVersionRange.fromMap(versionRangeMap);
        assertEquals(1, newVersionRange.min());
        assertEquals(2, newVersionRange.max());
        assertEquals(versionRange, newVersionRange);
    }
Unit tests for the SupportedVersionRange class.
Along the way, this suite also includes extensive tests for the base class BaseVersionRange.
clients/src/test/java/org/apache/kafka/common/feature/SupportedVersionRangeTest.java