@Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    LayoutSet newLayoutSet = _persistence.create(pk);

    newLayoutSet.setMvccVersion(RandomTestUtil.nextLong());

    newLayoutSet.setGroupId(RandomTestUtil.nextLong());

    newLayoutSet.setCompanyId(RandomTestUtil.nextLong());

    newLayoutSet.setCreateDate(RandomTestUtil.nextDate());

    newLayoutSet.setModifiedDate(RandomTestUtil.nextDate());

    newLayoutSet.setPrivateLayout(RandomTestUtil.randomBoolean());

    newLayoutSet.setLogoId(RandomTestUtil.nextLong());

    newLayoutSet.setThemeId(RandomTestUtil.randomString());

    newLayoutSet.setColorSchemeId(RandomTestUtil.randomString());

    newLayoutSet.setWapThemeId(RandomTestUtil.randomString());

    newLayoutSet.setWapColorSchemeId(RandomTestUtil.randomString());

    newLayoutSet.setCss(RandomTestUtil.randomString());

    newLayoutSet.setPageCount(RandomTestUtil.nextInt());

    newLayoutSet.setSettings(RandomTestUtil.randomString());

    newLayoutSet.setLayoutSetPrototypeUuid(RandomTestUtil.randomString());

    newLayoutSet.setLayoutSetPrototypeLinkEnabled(RandomTestUtil.randomBoolean());

    _layoutSets.add(_persistence.update(newLayoutSet));

    LayoutSet existingLayoutSet = _persistence.findByPrimaryKey(newLayoutSet.getPrimaryKey());

    Assert.assertEquals(existingLayoutSet.getMvccVersion(), newLayoutSet.getMvccVersion());
    Assert.assertEquals(existingLayoutSet.getLayoutSetId(), newLayoutSet.getLayoutSetId());
    Assert.assertEquals(existingLayoutSet.getGroupId(), newLayoutSet.getGroupId());
    Assert.assertEquals(existingLayoutSet.getCompanyId(), newLayoutSet.getCompanyId());
    Assert.assertEquals(
        Time.getShortTimestamp(existingLayoutSet.getCreateDate()),
        Time.getShortTimestamp(newLayoutSet.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingLayoutSet.getModifiedDate()),
        Time.getShortTimestamp(newLayoutSet.getModifiedDate()));
    Assert.assertEquals(existingLayoutSet.getPrivateLayout(), newLayoutSet.getPrivateLayout());
    Assert.assertEquals(existingLayoutSet.getLogoId(), newLayoutSet.getLogoId());
    Assert.assertEquals(existingLayoutSet.getThemeId(), newLayoutSet.getThemeId());
    Assert.assertEquals(existingLayoutSet.getColorSchemeId(), newLayoutSet.getColorSchemeId());
    Assert.assertEquals(existingLayoutSet.getWapThemeId(), newLayoutSet.getWapThemeId());
    Assert.assertEquals(
        existingLayoutSet.getWapColorSchemeId(), newLayoutSet.getWapColorSchemeId());
    Assert.assertEquals(existingLayoutSet.getCss(), newLayoutSet.getCss());
    Assert.assertEquals(existingLayoutSet.getPageCount(), newLayoutSet.getPageCount());
    Assert.assertEquals(existingLayoutSet.getSettings(), newLayoutSet.getSettings());
    Assert.assertEquals(
        existingLayoutSet.getLayoutSetPrototypeUuid(), newLayoutSet.getLayoutSetPrototypeUuid());
    Assert.assertEquals(
        existingLayoutSet.getLayoutSetPrototypeLinkEnabled(),
        newLayoutSet.getLayoutSetPrototypeLinkEnabled());
  }