Various data structure implementation in Java