Help me to design and implement the lazy buddy algorithm in java