atom.getTerm(i) in the interface should throw ArrayIndexOutOfBoundsException
if we try to match p(x,y) on a source containing p(x) we get java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
I propose to add an exception and handle it accordingly.