Adjusted implementation of test for matchEnded to reduce execution time with about 1 second