Shouldn't you compare the resources to not be the same instead of toString outputs?