joel-costigliola/assertj-guava — pull request #7 by andrew-m (2014-05-08 15:17:03+00:00)
Title: Equality of Optionals with tests.

Hi,

I've implemented isEqualTo for optionals, makes it easier to compare lots of optionals (for example optional fields on a larger class) and would be useful to us on a project where we use lots of optionals.

I wasn't sure about the error messages for failed assertions, so I've re-used existing ones where possible.
I also had trouble importing the assertJ eclipse settings, so I've manually formatted to match the other optional assertions and tests.

I've prepared an example, which I'll submit as a seperate pull request to the examples repo.

Feedback much appreciated.

Cheers - Andrew.

If both are absent, they're equal
If both are present, falls through to equality of the values.
If either (or both) are null (not even absent), fails.