Вильчинский - Лабораторная работа #1

Looks like [`peek`/`pool`](http://docs.oracle.com/javase/7/docs/api/java/util/Deque.html) methods can be useful to avoid throwing exceptions sometimes.