Basic data structure implementations in Java