The Gemara in Sanhedrin 44a says that Yehoshua knew that the malach of Hashem wasn’t a sheid because he did something that no sheid would do…