Add unit tests and error handling for the main lineCompare demo class