Book.java

1
package pl.zankowski.iextrading4j.api.marketdata;
2
3
import com.fasterxml.jackson.annotation.JsonCreator;
4
import com.fasterxml.jackson.annotation.JsonProperty;
5
import com.google.common.base.MoreObjects;
6
import com.google.common.base.Objects;
7
8
import java.util.List;
9
10
import static pl.zankowski.iextrading4j.api.util.ListUtil.immutableList;
11
12
public class Book implements DeepResult {
13
14
    private static final long serialVersionUID = -5500382403416100795L;
15
16
    private final String symbol;
17
    private final List<BookEntry> bids;
18
    private final List<BookEntry> asks;
19
20
    @JsonCreator
21
    public Book(
22
            @JsonProperty("symbol") final String symbol,
23
            @JsonProperty("bids") final List<BookEntry> bids,
24
            @JsonProperty("asks") final List<BookEntry> asks) {
25
        this.symbol = symbol;
26
        this.bids = immutableList(bids);
27
        this.asks = immutableList(asks);
28
    }
29
30
    public String getSymbol() {
31 1 1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/api/marketdata/Book::getSymbol → KILLED
        return symbol;
32
    }
33
34
    public List<BookEntry> getBids() {
35 1 1. getBids : replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/marketdata/Book::getBids → KILLED
        return bids;
36
    }
37
38
    public List<BookEntry> getAsks() {
39 1 1. getAsks : replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/marketdata/Book::getAsks → KILLED
        return asks;
40
    }
41
42
    @Override
43
    public boolean equals(Object o) {
44 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/marketdata/Book::equals → KILLED
        if (this == o) return true;
45 3 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/marketdata/Book::equals → KILLED
        if (o == null || getClass() != o.getClass()) return false;
46
        Book book = (Book) o;
47 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/marketdata/Book::equals → KILLED
        return Objects.equal(symbol, book.symbol) &&
48 1 1. equals : negated conditional → KILLED
                Objects.equal(bids, book.bids) &&
49 1 1. equals : negated conditional → KILLED
                Objects.equal(asks, book.asks);
50
    }
51
52
    @Override
53
    public int hashCode() {
54 1 1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/marketdata/Book::hashCode → KILLED
        return Objects.hashCode(symbol, bids, asks);
55
    }
56
57
    @Override
58
    public String toString() {
59 1 1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/marketdata/Book::toString → KILLED
        return MoreObjects.toStringHelper(this)
60
                .add("symbol", symbol)
61
                .add("bids", bids)
62
                .add("asks", asks)
63
                .toString();
64
    }
65
}

Mutations

31

1.1
Location : getSymbol
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:constructor()]
replaced return value with "" for pl/zankowski/iextrading4j/api/marketdata/Book::getSymbol → KILLED

35

1.1
Location : getBids
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:constructor()]
replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/marketdata/Book::getBids → KILLED

39

1.1
Location : getAsks
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:constructor()]
replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/marketdata/Book::getAsks → KILLED

44

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
negated conditional → KILLED

2.2
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
replaced boolean return with false for pl/zankowski/iextrading4j/api/marketdata/Book::equals → KILLED

45

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
negated conditional → KILLED

2.2
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
negated conditional → KILLED

3.3
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
replaced boolean return with true for pl/zankowski/iextrading4j/api/marketdata/Book::equals → KILLED

47

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
negated conditional → KILLED

2.2
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
replaced boolean return with true for pl/zankowski/iextrading4j/api/marketdata/Book::equals → KILLED

48

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
negated conditional → KILLED

49

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
negated conditional → KILLED

54

1.1
Location : hashCode
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:equalsContract()]
replaced int return with 0 for pl/zankowski/iextrading4j/api/marketdata/Book::hashCode → KILLED

59

1.1
Location : toString
Killed by : pl.zankowski.iextrading4j.api.marketdata.BookTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.marketdata.BookTest]/[method:toStringVerification()]
replaced return value with "" for pl/zankowski/iextrading4j/api/marketdata/Book::toString → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.1