Fix for getLatestValidGroupHealthStatus, created unit test case for the function.