Use a global logger.
Extract UDP broadcasting from server in a separate class.
Try to simplify the test for the UDP broadcast.