<commit_before>package org.requirementsascode;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set; 

public class Actor extends UseCaseModelElement{
	private Map<UseCase, List<UseCaseStep>> useCaseToStepMap;

	Actor(String name, UseCaseModel useCaseModel) {
		super(name, useCaseModel);
		this.useCaseToStepMap = new HashMap<>();
	}

	public Set<UseCase> getUseCases() {
		Set<UseCase> useCases = useCaseToStepMap.keySet();
		return Collections.unmodifiableSet(useCases);
	}

	public List<UseCaseStep> getUseCaseSteps(UseCase useCase) {
		List<UseCaseStep> steps = getModifiableUseCaseStepsList(useCase);
		return Collections.unmodifiableList(steps);
	}
	
	void newStep(UseCase namedUseCase, UseCaseStep namedUseCaseStep) {
		Objects.requireNonNull(namedUseCase);
		Objects.requireNonNull(namedUseCaseStep);
		
		List<UseCaseStep> steps = getModifiableUseCaseStepsList(namedUseCase);
		steps.add(namedUseCaseStep);
	}

	private List<UseCaseStep> getModifiableUseCaseStepsList(UseCase useCase) {
		useCaseToStepMap.putIfAbsent(useCase, new ArrayList<>());
		return useCaseToStepMap.get(useCase);
	}<commit_msg>Add more null-pointer checks to Actor class<commit_after>package org.requirementsascode;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set; 

public class Actor extends UseCaseModelElement{
	private Map<UseCase, List<UseCaseStep>> useCaseToStepMap;

	Actor(String name, UseCaseModel useCaseModel) {
		super(name, useCaseModel);
		this.useCaseToStepMap = new HashMap<>();
	}

	public Set<UseCase> getUseCases() {
		Set<UseCase> useCases = useCaseToStepMap.keySet();
		return Collections.unmodifiableSet(useCases);
	}

	public List<UseCaseStep> getUseCaseSteps(UseCase useCase) {
		Objects.requireNonNull(useCase);

		List<UseCaseStep> steps = getModifiableUseCaseStepsList(useCase);
		return Collections.unmodifiableList(steps);
	}
	
	void newStep(UseCase namedUseCase, UseCaseStep namedUseCaseStep) {
		Objects.requireNonNull(namedUseCase);
		Objects.requireNonNull(namedUseCaseStep);
		
		List<UseCaseStep> steps = getModifiableUseCaseStepsList(namedUseCase);
		steps.add(namedUseCaseStep);
	}

	private List<UseCaseStep> getModifiableUseCaseStepsList(UseCase useCase) {
		Objects.requireNonNull(useCase);
		
		useCaseToStepMap.putIfAbsent(useCase, new ArrayList<>());
		return useCaseToStepMap.get(useCase);
	}
{'fraction_non_alphanumeric': 0.09984459984459984, 'fraction_numerical': 0.0, 'mean_word_length': 6.803030303030303, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2770702', 'n_tokens_mistral': 874, 'n_tokens_neox': 827, 'n_words': 150}