Atlassian interview question

Implement a circular buffer in Java