Sample implementation in Java