1st or 4th since 2nd is the same thing as you actually have and doesnt validate anything and 3rd use instanceof which is meh ;/