@Nonnull
    @EvolvingApi
    public <T, S extends StreamSerializer<T>> JobConfig registerSerializer(
            @Nonnull Class<T> clazz,
            @Nonnull Class<S> serializerClass
    ) {
        throwIfLocked();
        Preconditions.checkFalse(serializerConfigs.containsKey(clazz.getName()),
                "Serializer for " + clazz + " already registered");
        serializerConfigs.put(clazz.getName(), serializerClass.getName());
        return this;
    }
@Test
    public void when_registerSerializerTwice_then_fails() {
        // Given
        JobConfig config = new JobConfig();
        config.registerSerializer(Object.class, ObjectSerializer.class);

        // When
        // Then
        Assert.assertThrows("Serializer for class java.lang.Object already registered", IllegalArgumentException.class,
                () -> config.registerSerializer(Object.class, ObjectSerializer.class));
    }