protected LayoutPrototype addLayoutPrototype(
      Map<String, List<StagedModel>> dependentStagedModelsMap) throws Exception {

    _layoutPrototype = LayoutTestUtil.addLayoutPrototype(RandomTestUtil.randomString());

    addDependentStagedModel(dependentStagedModelsMap, LayoutPrototype.class, _layoutPrototype);

    List<Layout> layouts =
        LayoutLocalServiceUtil.getLayouts(
            _layoutPrototype.getGroupId(), true, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID);

    Assert.assertEquals(1, layouts.size());

    Layout layout = layouts.get(0);

    addDependentStagedModel(dependentStagedModelsMap, Layout.class, layout);

    addLayout(LayoutPrototype.class, layout);

    List<LayoutFriendlyURL> layoutFriendlyURLs =
        LayoutFriendlyURLLocalServiceUtil.getLayoutFriendlyURLs(layout.getPlid());

    Assert.assertEquals(1, layoutFriendlyURLs.size());

    addDependentStagedModel(
        dependentStagedModelsMap, LayoutFriendlyURL.class, layoutFriendlyURLs.get(0));

    addLayoutFriendlyURLs(LayoutPrototype.class, layout.getPlid());

    return _layoutPrototype;
  }
  @Test
  public void testExportImportLayoutSetPrototypeInvalidLARType() throws Exception {

    // Import a layout set prototype to a layout set

    LayoutSetPrototype layoutSetPrototype =
        LayoutTestUtil.addLayoutSetPrototype(RandomTestUtil.randomString());

    try {
      group = layoutSetPrototype.getGroup();
      importedGroup = GroupTestUtil.addGroup();

      long[] layoutIds = new long[0];

      try {
        exportImportLayouts(layoutIds, getImportParameterMap());

        Assert.fail();
      } catch (LARTypeException lte) {
      }

      // Import a layout set prototype to a layout prototyope

      LayoutPrototype layoutPrototype =
          LayoutTestUtil.addLayoutPrototype(RandomTestUtil.randomString());

      importedGroup = layoutPrototype.getGroup();

      try {
        exportImportLayouts(layoutIds, getImportParameterMap());

        Assert.fail();
      } catch (LARTypeException lte) {
      }
    } finally {
      LayoutSetPrototypeLocalServiceUtil.deleteLayoutSetPrototype(layoutSetPrototype);

      group = null;
    }
  }