I am trying to check my pair against a unit test but the output from the function returns the pair with pair values separated with "=" instead of ",". I tried type casting and other workarounds but can't figure out whats making this happen.
Function return type :
Pair<ArrayList<Pair<Entity, Integer>>, Integer>
ArrayList<Pair<Entity, Integer>> pairMatches = new ArrayList<Pair<Entity, Integer>>();
pairMatches.add(new Pair<>(entities.get(i-1), ped)); // entities is a class object
// Finally returning
return (new Pair<>(pairMatches, pedComputations)); // pedComputations and ped are Integer
Output reads : [Entity(name="frei", score=3, description="a word")=0]=1
Expected : ([(Entity(name="frei", score=3, description="a word"), 0)], 1)
@Override
public String toString() {
return ("Entity(name=\"" + this.name + "\", score=" + this.score
+ ", description=\"" + this.description + "\")");
}
Thank you !