HashMapBundle.java

1
package g0803.bindingofshiba.bundles;
2
3
import java.util.HashMap;
4
import java.util.Set;
5
6
public class HashMapBundle<T> implements Bundle<T> {
7
8
    private final HashMap<String, T> bundle = new HashMap<>();
9
10
    @Override
11
    public void register(String name, T data) {
12
        bundle.put(name, data);
13
    }
14
15
    @Override
16
    public T get(String name) {
17 1 1. get : negated conditional → KILLED
        if (!bundle.containsKey(name))
18
            throw new IllegalArgumentException("Key " + name + " not found in bundle");
19
20 1 1. get : replaced return value with null for g0803/bindingofshiba/bundles/HashMapBundle::get → KILLED
        return bundle.get(name);
21
    }
22
23
    @Override
24
    public Set<String> keys() {
25 1 1. keys : replaced return value with Collections.emptySet for g0803/bindingofshiba/bundles/HashMapBundle::keys → KILLED
        return bundle.keySet();
26
    }
27
}

Mutations

17

1.1
Location : get
Killed by : g0803.bindingofshiba.bundles.HashMapBundleTest.[engine:junit-jupiter]/[class:g0803.bindingofshiba.bundles.HashMapBundleTest]/[method:entryIsRegistered()]
negated conditional → KILLED

20

1.1
Location : get
Killed by : g0803.bindingofshiba.bundles.HashMapBundleTest.[engine:junit-jupiter]/[class:g0803.bindingofshiba.bundles.HashMapBundleTest]/[method:entryIsRegistered()]
replaced return value with null for g0803/bindingofshiba/bundles/HashMapBundle::get → KILLED

25

1.1
Location : keys
Killed by : g0803.bindingofshiba.bundles.HashMapBundleTest.[engine:junit-jupiter]/[class:g0803.bindingofshiba.bundles.HashMapBundleTest]/[method:keys()]
replaced return value with Collections.emptySet for g0803/bindingofshiba/bundles/HashMapBundle::keys → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.0