@Test
  public void testSharePermissionEquals() {
    final SharePermission perm1 =
        new SharePermissionImpl(TestSharePermissionImpl.TYPE, TestSharePermissionImpl.PARAM1, null);
    final SharePermission perm2 =
        new SharePermissionImpl(
            TestSharePermissionImpl.ID,
            TestSharePermissionImpl.TYPE,
            TestSharePermissionImpl.PARAM1,
            null);
    final SharePermission perm3 =
        new SharePermissionImpl(
            TestSharePermissionImpl.TYPE,
            TestSharePermissionImpl.PARAM1,
            TestSharePermissionImpl.PARAM2);

    assertEquals(perm1, perm1);
    assertEquals(perm2, perm2);
    assertEquals(perm3, perm3);

    assertEquals(perm1, perm2);
    assertFalse(perm1.equals(perm3));
    assertFalse(perm2.equals(perm3));
    assertFalse(perm2.equals(null));
  }
  @Test
  public void testSharePermissionImplWithGoodParams() {
    SharePermission perm =
        new SharePermissionImpl(TestSharePermissionImpl.TYPE, TestSharePermissionImpl.PARAM1, null);
    assertNull(perm.getId());
    assertEquals(TestSharePermissionImpl.TYPE, perm.getType());
    assertEquals(TestSharePermissionImpl.PARAM1, perm.getParam1());
    assertNull(perm.getParam2());

    perm =
        new SharePermissionImpl(
            TestSharePermissionImpl.TYPE,
            TestSharePermissionImpl.PARAM1,
            TestSharePermissionImpl.PARAM2);
    assertNull(perm.getId());
    assertEquals(TestSharePermissionImpl.TYPE, perm.getType());
    assertEquals(TestSharePermissionImpl.PARAM1, perm.getParam1());
    assertEquals(TestSharePermissionImpl.PARAM2, perm.getParam2());

    perm =
        new SharePermissionImpl(
            TestSharePermissionImpl.ID,
            TestSharePermissionImpl.TYPE,
            TestSharePermissionImpl.PARAM1,
            TestSharePermissionImpl.PARAM2);
    assertEquals(TestSharePermissionImpl.ID, perm.getId());
    assertEquals(TestSharePermissionImpl.TYPE, perm.getType());
    assertEquals(TestSharePermissionImpl.PARAM1, perm.getParam1());
    assertEquals(TestSharePermissionImpl.PARAM2, perm.getParam2());
  }