VerifiableInvocationsFinder.java revision e0ae5d7e87b1dd6e789803c1b9615a84bd7488b7
1/*
2 * Copyright (c) 2007 Mockito contributors
3 * This program is made available under the terms of the MIT License.
4 */
5
6package org.mockito.internal.invocation.finder;
7
8import org.mockito.internal.util.collections.ListUtil;
9import org.mockito.invocation.Invocation;
10
11import java.util.List;
12
13/**
14 * Author: Szczepan Faber, created at: 4/3/11
15 */
16public class VerifiableInvocationsFinder {
17
18    public List<Invocation> find(List<?> mocks) {
19        List<Invocation> invocations = new AllInvocationsFinder().find(mocks);
20        return ListUtil.filter(invocations, new RemoveIgnoredForVerification());
21    }
22
23    static class RemoveIgnoredForVerification implements ListUtil.Filter<Invocation>{
24        public boolean isOut(Invocation i) {
25            return i.isIgnoredForVerification();
26        }
27    }
28}
29