Simple HashTable simulation in Java