Working through some Java data structure examples