[java] Ring Buffer in Java