package innovimax.mixthem.join;

import innovimax.mixthem.exceptions.MixException;
import innovimax.mixthem.interfaces.IJoinLine;

/**
* <p>Joins two lines on a common field.</p>
* <p>This is the default implementation of IJoinLine.</p>
* @see IJoinLine
* @author Innovimax
* @version 1.0
*/
public class DefaultLineJoining implements IJoinLine {

	@Override
	public String join(String line1, String line2) throws MixException {
		return line1 + line2;
	}

}

@@ -124,16 +124,116 @@
 nLine;%0A%0A
+import java.util.LinkedList;%0Aimport java.util.StringTokenizer;%0Aimport java.util.stream.Collectors;%0A%0A
 /**%0A* %3Cp
@@ -528,28 +528,606 @@
 %7B%0A%09%09
-return line1 + line2
+LinkedList%3CString%3E list1 = new LinkedList%3CString%3E();%0A%09%09StringTokenizer st1 = new StringTokenizer(%22 %22);%0A%09%09while (st1.hasMoreTokens()) %7B%0A%09%09%09list1.add(st1.nextToken());%0A%09%09%7D%0A%09%09LinkedList%3CString%3E list2 = new LinkedList%3CString%3E();%0A%09%09StringTokenizer st2 = new StringTokenizer(%22 %22);%0A%09%09while (st2.hasMoreTokens()) %7B%0A%09%09%09list2.add(st2.nextToken());%0A%09%09%7D%0A%09%09if (list2.contains(list1.getFirst())) %7B%0A%09%09%09String part1 = list1.stream().collect(Collectors.joining(%22 %22));%0A%09%09%09String part2 = list2.stream().filter(s -%3E !list1.contains(s)).collect(Collectors.joining(%22 %22));%0A%09%09%09return part1 + %22 %22 + part2;%0A%09%09%7D%0A%09%09return null
 ;%0A%09%7D

Update DefaultLineJoining.java