Usual practice I have seen so far is to check like this:

```
if (object != null) {...}

```

But today I have encountered the following situation:

```
if (object) {...}

```

Are these two lines COMPLETELY equivalent? The latter seems little bit strange to me, since the object is not neccesary a Boolean. Is it better(shorter) to write in latter way?