public Optional<Integer> declareManagedMemoryUseCaseAtOperatorScope(
            ManagedMemoryUseCase managedMemoryUseCase, int weight) {
        checkNotNull(managedMemoryUseCase);
        checkArgument(
                managedMemoryUseCase.scope == ManagedMemoryUseCase.Scope.OPERATOR,
                "Use case is not operator scope.");
        checkArgument(weight > 0, "Weights for operator scope use cases must be greater than 0.");

        return Optional.ofNullable(
                managedMemoryOperatorScopeUseCaseWeights.put(managedMemoryUseCase, weight));
    }
@Test
    void testDeclareManagedMemoryOperatorScopeUseCaseFailNegativeWeight() {
        assertThatThrownBy(
                        () ->
                                transformation.declareManagedMemoryUseCaseAtOperatorScope(
                                        ManagedMemoryUseCase.OPERATOR, -1))
                .isInstanceOf(IllegalArgumentException.class);
    }