import java.util.List;

public record Movie(String title, int year, int duration, List<String> cast) {

    public Movie {
        if (title == null || title.isEmpty()) {
            throw new IllegalArgumentException();
        }
        cast = List.copyOf(cast);
    }
}
