• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / jmockit1 / 496

15 Nov 2025 05:33PM UTC coverage: 72.192% (-0.008%) from 72.2%
496

push

github

web-flow
Merge pull request #412 from hazendaz/renovate/major-spring-core

Update spring core to v7 (major)

5677 of 8360 branches covered (67.91%)

Branch coverage included in aggregate %.

11922 of 16018 relevant lines covered (74.43%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.21
/main/src/main/java/mockit/internal/expectations/argumentMatching/CaptureMatcher.java
1
/*
2
 * MIT License
3
 * Copyright (c) 2006-2025 JMockit developers
4
 * See LICENSE file for full license text.
5
 */
6
package mockit.internal.expectations.argumentMatching;
7

8
import edu.umd.cs.findbugs.annotations.NonNull;
9
import edu.umd.cs.findbugs.annotations.Nullable;
10

11
import java.util.List;
12

13
public final class CaptureMatcher<T> implements ArgumentMatcher<CaptureMatcher<T>> {
14
    @NonNull
15
    private final List<T> valueHolder;
16
    @Nullable
17
    private Class<?> expectedType;
18

19
    public CaptureMatcher(@NonNull List<T> valueHolder) {
1✔
20
        this.valueHolder = valueHolder;
1✔
21
    }
1✔
22

23
    public void setExpectedType(@NonNull Class<?> expectedType) {
24
        this.expectedType = expectedType;
1✔
25
    }
1✔
26

27
    @Override
28
    public boolean same(@NonNull CaptureMatcher<T> other) {
29
        return false;
×
30
    }
31

32
    @Override
33
    public boolean matches(@Nullable Object argValue) {
34
        if (expectedType == null || expectedType.isInstance(argValue)
1✔
35
                || argValue == null && !expectedType.isPrimitive()) {
1!
36
            // noinspection unchecked
37
            valueHolder.add((T) argValue);
1✔
38
        }
39

40
        return true;
1✔
41
    }
42

43
    @Override
44
    public void writeMismatchPhrase(@NonNull ArgumentMismatch argumentMismatch) {
45
    }
×
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc