Bug 95908 [5.0][content assist] toarray template inserted as content assist method argument guess
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuesser.java
final char[] triggers= new char[v.triggerChars.length + 1];
			System.arraycopy(v.triggerChars, 0, triggers, 0, v.triggerChars.length);
			String displayString= v.isAutoboxingMatch ? v.name : v.name;
			triggers[triggers.length - 1]= ';';
			ICompletionProposal proposal= new PositionBasedCompletionProposal(v.name, pos, replacementLength, getImage(v.descriptor), displayString, null, null) {
				public char[] getTriggerCharacters() {
					return triggers;
				}
			};
			ret[i++]= proposal;
		}
		if (fIsTemplateMatch) {
			ret[i++]= createTemplateProposal(document, pos, paramType);
		}
		return ret;
	}
	private TemplateProposal createTemplateProposal(IDocument document, Position position, String templateType) {
		String dimensionLess= templateType.substring(0, templateType.length() - 2);
		TemplateContextType contextType= JavaPlugin.getDefault().getTemplateContextRegistry().getContextType("java"); 
		position.offset= getCompletionOffset(document.get(), fCodeAssistOffset);
		JavaContext context= new PositionBasedJavaContext(contextType, document, position, fCompilationUnit);
		context.getCollections(); 
		context.setForceEvaluation(true);
		context.setVariable("type", dimensionLess); 
		IRegion region= new Region(fCodeAssistOffset, 0);
		Template toArray= JavaPlugin.getDefault().getTemplateStore().findTemplate("toarray"); 
		TemplateProposal proposal= new TemplateProposal(toArray, context, region, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE));
		return proposal;
	}
	private static class MatchComparator implements Comparator {