// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/pages/todolist/ClearCompleted.java
// public class ClearCompleted extends PageObject {
//     public static final Target BUTTON = Target.the("Clear completed button").locatedBy("#clear-completed");
// }


import com.google.common.collect.ImmutableMap;
import net.serenitybdd.demos.todos.pages.todolist.ClearCompleted;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;
import net.serenitybdd.screenplay.questions.Visibility;
import java.util.Map;
package net.serenitybdd.demos.todos.questions;



@Subject("the 'Clear Completed' option")
public class ClearCompletedItemsOptionAvailability implements Question<ElementAvailability> {

    private final Map<Boolean, ElementAvailability> ELEMENT_AVAILABILITY =
            ImmutableMap.of(
                    Boolean.TRUE, ElementAvailability.Available,
                    Boolean.FALSE, ElementAvailability.Unavailable
                    );

    @Override
    public ElementAvailability answeredBy(Actor actor) {
// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/pages/todolist/ClearCompleted.java
// public class ClearCompleted extends PageObject {
//     public static final Target BUTTON = Target.the("Clear completed button").locatedBy("#clear-completed");
// }


// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/questions/ClearCompletedItemsOptionAvailability.java
import com.google.common.collect.ImmutableMap;
import net.serenitybdd.demos.todos.pages.todolist.ClearCompleted;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;
import net.serenitybdd.screenplay.questions.Visibility;
import java.util.Map;

package net.serenitybdd.demos.todos.questions;



@Subject("the 'Clear Completed' option")
public class ClearCompletedItemsOptionAvailability implements Question<ElementAvailability> {

    private final Map<Boolean, ElementAvailability> ELEMENT_AVAILABILITY =
            ImmutableMap.of(
                    Boolean.TRUE, ElementAvailability.Available,
                    Boolean.FALSE, ElementAvailability.Unavailable
                    );

    @Override
    public ElementAvailability answeredBy(Actor actor) {
        Boolean clearCompleteButtonIsVisible = Visibility.of(ClearCompleted.BUTTON).viewedBy(actor).value();