Simplify asTimestampOfType(…) retrieval and move the cast to outer method. Simplify test. Original pull request: #624.