deque: refactor test methods by reducing lines of code number