int offset= document.search(0, replacedString, true, true, false);
int offset= document.get().indexOf(replacedString);
	public void testSearchInWorkingCopies() throws Exception {			IPackageFragmentRoot root1= JavaProjectHelper.addSourceContainer(fJavaProject1, "src");		IPackageFragment pack1= root1.createPackageFragment("pack1", true, null);				StringBuffer buf= new StringBuffer();		buf.append("public class A {\n");		buf.append("}\n");		ICompilationUnit cu1= pack1.getCompilationUnit("A.java");		cu1.createType(buf.toString(), null, true, null);		buf= new StringBuffer();		buf.append("public class B {\n");		buf.append("    A a;\n");		buf.append("}\n");		ICompilationUnit cu2= pack1.getCompilationUnit("B.java");		cu2.createType(buf.toString(), null, true, null);				IPackageFragment pack2= root1.createPackageFragment("pack2", true, null);				buf= new StringBuffer();		buf.append("public class C {\n");		buf.append("    //Here\n");		buf.append("}\n");		ICompilationUnit cu3= pack2.getCompilationUnit("C.java");		cu3.createType(buf.toString(), null, true, null);						// empty array when USE_WORKING_COPY_OWNERS is true		IWorkingCopy[] workingCopies= JavaUI.getSharedWorkingCopiesOnClasspath();		List result= doSearchForReferences("A", JavaUI.getSharedWorkingCopiesOnClasspath());		assertTrue("Should contain 1 references, contains: " + result.size(), result.size() == 1);				IEditorPart part= EditorUtility.openInEditor(cu3);		try {			IDocument document= JavaUI.getDocumentProvider().getDocument(part.getEditorInput());			String replacedString= "//Here";						int offset= document.search(0, replacedString, true, true, false);						document.replace(offset, replacedString.length(), "A a;");						workingCopies= JavaUI.getSharedWorkingCopiesOnClasspath();			result= doSearchForReferences("A", workingCopies);			assertTrue("Should contain 2 references, contains: " + result.size(), result.size() == 2);			//save			part.doSave(null);			workingCopies= JavaUI.getSharedWorkingCopiesOnClasspath();			result= doSearchForReferences("A", workingCopies);			assertTrue("Should contain 2 references, contains: " + result.size(), result.size() == 2);					} finally {			JavaPlugin.getActivePage().closeAllEditors(false);		}				workingCopies= JavaUI.getSharedWorkingCopiesOnClasspath();		result= doSearchForReferences("A", workingCopies);		assertTrue("Should contain 2 references, contains: " + result.size(), result.size() == 2);	}