}
}
IType resultType = result.getTypes()[0];
String name = resultType.getElementName();
ISourceReference ref = resultType;
ISourceRange docRange = resultType.getJavadocRange();
IJavaElement element = src.getElementAt(offset);
if(element != null && element.getElementType() == IJavaElement.METHOD){
IMethod method = null;
if (finder.isTest(src.getTypes()[0])){
method = JUnitUtils.findClassMethod(result, (IMethod)element);
}else{
method = JUnitUtils.findTestMethod(result, (IMethod)element);
}
if (method != null){
name = method.getElementName();
ref = method;
docRange = method.getJavadocRange();
}
}
String lineDelim = result.findRecommendedLineSeparator();
int docLength = docRange != null ?
docRange.getLength() + lineDelim.length() : 0;
return Position.fromOffset(
result.getResource().getLocation().toOSString(), name,
ref.getSourceRange().getOffset() + docLength, 0);
}