@SuppressWarnings("removal")
    public static int getPortableVersion(Portable portable, int defaultVersion) {
        int version = defaultVersion;
        if (portable instanceof VersionedPortable versionedPortable) {
            version = versionedPortable.getClassVersion();
            if (version < 0) {
                throw new IllegalArgumentException("Version cannot be negative!");
            }
        }
        return version;
    }
@Test(expected = IllegalArgumentException.class)
    public void testGetPortableVersion_negativeVersion() {
        SerializationUtil.getPortableVersion(new DummyVersionedPortable(), 1);
    }