Aha! It is indeed a Java error
if ((String) member.getSpecId() == (String) targetShip){
Should be:
if (member.getSpecId() != null && member.getSpecId().equals(targetShip)){
== compares the values of the references - i.e., whether those two are actually the
same String object, not whether the object has the same contents. equals() is a function available on all objects that actually compares their contents.
The "member.getSpecId() != null" part is just to be safe. getSpecId() should never return null, but in general, if you're dealing with an API and aren't sure whether null is a valid return value for a given function, it doesn't hurt to check before using it.