I incorrectly specified the timezone as UTC, when it needs to be
given the local timezone (so it can convert the always-in-UTC
epoch time into the correct local time).
Stop swimming against the tide and accept what most of the rest of
the world does.
While it adds an annoying depth to the actual source code, it makes
the root directory nicer (no more 'test-res' dirs), means we don't
have to override the gradle config, and makes it nicer to work in
IDEA 2016.1.
OutputQueue is now abstract, and the different queue methods
are subclasses.
This allows the same flexibility as before (subclasses can change
the type of items they add, implement their own throttling logic,
and say how the queue is ordered).
Organising it this way makes the package a lot easier to understand
as there's no longer a messy separation of concerns between
OutputQueue and QueueHandler (e.g. the output stream is no longer
in two places with two send methods, all of the definitions
relating to how the queue works are in one place, etc).
Instead of having lots of objects implement Comparable or Comparator,
pass the comparator in to the PriorityBlockingQueue.
This requires recreating the queue if the QueueHandler is ever changed,
but the previous behaviour resulted in an unstable/undefined ordering,
so it's probably better this way anyway.
This means that QueueItems no longer need to know about QueueHandler,
which makes me slightly happier.
This allows the logic to be expressed more nicely and tested
independently of the handlers. It also paves the way for a
bit of refactoring to reduce the number of random things
that need to be comparable...
Use Java8 date types for parser queue items. Fix the time check in
QueueHandler to check if the item has been queued for longer than
10 seconds, rather than if the item was created within 10 seconds
of the epoch.