/**
* computes the echarge of this
* @post | getAlphas().stream().anyMatch(el -> Math.abs(result) == el.getBalls().size())
* @post | getAlphas().size() % 2 == 0 ? result > 0 : result < 0
* @inspects | this
*/
int regetEchargePkg() {
int sig = alphaSizeToSign();
int val = 1;
for (Alpha alph : linkedAlphas) {
if (alph.linkedBalls.size() > val) { val = alph.linkedBalls.size(); }
}
return sig * val;
}
sig is the value 1 or -1. getBalls() and getAlphas() give respectively a shallow copy of linkedBalls and linkedAlphas. Any idea why the first post condition would not hold? If more information is needed pls ask. Thnx