All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.screenplay.questions.SumQuestion Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.screenplay.questions;

import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;

import java.util.Collection;

@Subject("the sum of #listQuestion")
public class SumQuestion implements Question {

    private final Question> listQuestion;

    public SumQuestion(Question> listQuestion) {
        this.listQuestion = listQuestion;
    }

    @Override
    public Integer answeredBy(Actor actor) {
        Integer total = 0;
        for (Integer number : listQuestion.answeredBy(actor)) {
            total = total + number;
        }
        return total;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy