Task Description: Implement a Simple To-Do List Application
You are required to create a simple To-Do List application that allows users to manage their tasks. The application must have the following functionalities:
Add Task: Implement a function to add a new task to the to-do list. Each task should have a title (string) and a unique identifier (integer).
Remove Task: Implement a function to remove a task from the list by its unique identifier.
Get All Tasks: Implement a function to retrieve all tasks from the list. This function should return an array of tasks, where each task is represented by an object containing its id and title.
Mark Task as Completed: Implement a function to mark a task as completed. This function should accept the task's unique identifier and update a boolean property completed for the corresponding task.
Get Pending Tasks: Implement a function to return all tasks that are not completed.
Your implementation should reside in the /app/ directory, and it should adhere to the following requirements to ensure that all provided tests pass:
Define a class TodoList that encapsulates all the above functionalities.
Ensure that tasks can be uniquely identified and that adding and removing tasks functions correctly handle potential errors (e.g., trying to remove a task that doesn't exist).
Make sure to include comprehensive error handling and validation for inputs.
Include comments and/or documentation within the code explaining the purpose of each method.
Make sure to run the provided test suite to verify that all functionalities work as expected.