### Question:
SemverSchemaVersioner implements SchemaVersioner { @Override public SchemaVersion determineVersion(final String protoPackage, @Nullable final SchemaVersion currentVersion, final DescriptorSet current, final DescriptorSet candidate) { final String majorVersion = getMajorVersion(protoPackage); if (currentVersion == null) { return SchemaVersion.create(majorVersion, 0, 0); } Preconditions.checkState(Objects.equals(majorVersion, currentVersion.major())); if (hasMinorVersionChange(protoPackage, current, candidate)) { final int minorVersion = currentVersion.minor() + 1; return SchemaVersion.create(majorVersion, minorVersion, 0); } if (hasPatchVersionChange(protoPackage, current, candidate)) { final int patchVersion = currentVersion.patch() + 1; return SchemaVersion.create(majorVersion, currentVersion.minor(), patchVersion); } return currentVersion; } private  SemverSchemaVersioner(); static SemverSchemaVersioner create(); @Override SchemaVersion determineVersion(final String protoPackage,
                                        @Nullable final SchemaVersion currentVersion,
                                        final DescriptorSet current,
                                        final DescriptorSet candidate);  }### Answer:
@Test @Parameters(method = "testParams") public void testDetermineVersion(final Path root, final String protoPackage, final SchemaVersion currentVersion, final SchemaVersion expectedVersion) throws Exception { final SemverSchemaVersioner sut = SemverSchemaVersioner.create(); final DescriptorSetPair descriptorSetPair = DescriptorSetUtils.buildDescriptorSetPair(root); final SchemaVersion version = sut.determineVersion( protoPackage, currentVersion, descriptorSetPair.current(), descriptorSetPair.candidate() ); assertThat(version, equalTo(expectedVersion)); }