public void testExternalizeJUnitConfiguration()
      throws WriteExternalException, InvalidDataException {
    JUnitConfiguration configuration = createConfiguration(findTestA(getModule1()));
    Element element = new Element("cfg");
    configuration.writeExternal(element);
    JUnitConfiguration newCfg =
        new JUnitConfiguration(
            null, myProject, JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);

    newCfg.readExternal(element);
    checkTestObject(configuration.getPersistentData().TEST_OBJECT, newCfg);
    assertEquals(
        Collections.singleton(getModule1()), ContainerUtilRt.newHashSet(newCfg.getModules()));
    checkClassName(configuration.getPersistentData().getMainClassName(), newCfg);
  }