You have:
if (roomTemp.getName() == roomName)
You mean:
if (roomTemp.getName().equals(roomName))
Do not compare strings with ==
!
Use equalsIgnoreCase()
if names are case-insensitive. Use trim()
first if leading/trailing whitespace is an issue.
By the way, if an RMIRoomImpl
's name never changes, you may find a Map<String,RMIRoomImpl>
to be more convenient.