Implement a function that calculates the factorial of a list of non-negative integers.
Functionality Requirements:
Create a function calculate_factorials(test_cases) that takes a list of non-negative integers as input and returns a list of their corresponding factorials.
The function should handle varying lengths of input lists and compute factorial using a recursive helper function factorial(n) which should return 1 for inputs 0 or 1, and compute the factorial for other non-negative integers.
Input/Output Requirements:
Input: A list of non-negative integers, where each integer is an element of the list. For example: [0, 1, 5, 3].
Output: A list of calculated factorials corresponding to each input integer. For example, for the input [0, 1, 5, 3], the output should be [1, 1, 120, 6].
Actionable Steps:
Implement the function in a file named /app/solution.py.
Include appropriate comments and ensure the code adheres to Python conventions for clarity.
Make sure to test the function using various test cases to ensure correctness.