private static List<Template> sortTemplates(List<Template> templates)
	{
		List<Template> result = new ArrayList<Template>();
		for (Template t : templates)
		{
			int pos = 0;
			while (pos < result.size()
					&& t.getPos().getStart() > result.get(pos).getPos()
							.getStart())
			{
				pos++;
			}
			result.add(pos, t);
		}
		return result;
	}
private static List < Template > sortTemplates ( List < Template > templates ) { List < Template > result = new ArrayList < Template > ( ) ; for ( Template t : templates ) { int pos = 0 ; while ( pos < result . size ( ) && t . getPos ( ) . getStart ( ) > result . get ( pos ) . getPos ( ) . getStart ( ) ) { pos ++ ; } result . add ( pos , t ) ; } return result ; }
Sorts the Templates...