An implementation in Java of the all-sums algorithm