@Test
public void equalsTest() {

    final CloudnamePath twoA = new CloudnamePath(twoElements);
    final CloudnamePath twoB = new CloudnamePath(twoElements);
    final CloudnamePath none = new CloudnamePath(emptyElements);
    final CloudnamePath entirelyDifferent = new CloudnamePath(new String[] { "foo", "2" });
    assertThat("Identical paths are equal", twoA.equals(twoB), is(true));
    assertThat("Hash codes for equal objects are the same",
            twoA.hashCode(), is(twoB.hashCode()));
    assertThat("Identical paths are equal, ignore order", twoB, is(equalTo(twoA)));
    assertThat("Paths aren't equal to strings", twoA.equals(""), is(false));
    assertThat("Empty path does not equal actual path", twoA, is(not(equalTo(none))));
    assertThat("Null elements aren't equal", twoA.equals(null), is(false));
    assertThat("Differen is just different", twoA, is(not(equalTo(entirelyDifferent))));
}