added some junit tests, and fixed a minor case in isAbeam