BerlinClock implementation and tests