<commit_before>package de.retest.recheck.ui.descriptors;

import static de.retest.recheck.ui.Path.fromString;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

import java.util.List;
import java.util.UUID;

import org.junit.Test;

import de.retest.recheck.ui.Path;
import de.retest.recheck.ui.diff.AttributeDifference;
import de.retest.recheck.ui.review.ActionChangeSet;
import de.retest.recheck.util.RetestIdUtil.InvalidRetestIdException;

public class ElementTest {

	private static class Parent {}

	private final static RootElement rootElement = mock( RootElement.class );
<commit_msg>Add testcase for proper parent<commit_after>package de.retest.recheck.ui.descriptors;

import static de.retest.recheck.ui.Path.fromString;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

import java.util.List;
import java.util.UUID;

import org.junit.Test;

import de.retest.recheck.ui.Path;
import de.retest.recheck.ui.diff.AttributeDifference;
import de.retest.recheck.ui.review.ActionChangeSet;
import de.retest.recheck.util.RetestIdUtil.InvalidRetestIdException;

public class ElementTest {

	private static class Parent {}

	private final static RootElement rootElement = mock( RootElement.class );

	@Test
	public void applyChanges_should_return_element_with_proper_parent() {
		final RootElement parent = new RootElement( "ID",
				IdentifyingAttributes.create( fromString( "parent[0]/" ), java.awt.Component.class ), new Attributes(),
				null, "", 0, "" );

		final Element child = Element.create( "ID", parent,
				IdentifyingAttributes.create( fromString( "parent[0]/child[0]" ), java.awt.Component.class ),
				new Attributes() );

		final Element newChild = child.applyChanges( new ActionChangeSet() );

		assertThat( newChild.getParent() ).isEqualTo( child.getParent() );
	}

{'fraction_non_alphanumeric': 0.11288604898828541, 'fraction_numerical': 0.002129925452609159, 'mean_word_length': 5.347972972972973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4263546', 'n_tokens_mistral': 611, 'n_tokens_neox': 588, 'n_words': 122}