@Test
public void testEqualsLoose() {

    // Arrays
    assertEqualsLoose(null, new String[0]);
    assertEqualsLoose(new String[0], null);
    // Lists
    assertEqualsLoose(null, new ArrayList<Serializable>());
    assertEqualsLoose(new ArrayList<Serializable>(), null);
    // States
    assertEqualsLoose(new State(), null);
    assertEqualsLoose(null, new State());
    State a = new State();
    State b = new State();
    assertEqualsLoose(a, b);
    a.put("foo", null);
    a.put("bar", null);
    assertEqualsLoose(a, b);
    a.put("foo", "bar");
    b.put("foo", "bar");
    assertEqualsLoose(a, b);
    b.put("gee", null);
    assertEqualsLoose(a, b);
    // empty elements considered null
    State c = new State();
    assertEqualsLoose(c, null);
    c.put("foo", list());
    assertEqualsLoose(c, null);
}