added junit tests