Code cleanup.
diff --git a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/model/ProtobufDocumentProvider_Test.java b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/model/ProtobufDocumentProvider_Test.java
index 7f17b53..e8b10ba 100644
--- a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/model/ProtobufDocumentProvider_Test.java
+++ b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/model/ProtobufDocumentProvider_Test.java
@@ -8,18 +8,16 @@
  */
 package com.google.eclipse.protobuf.ui.editor.model;
 
-import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.ui.preferences.editor.save.SaveActionsTestPreferences.RemoveTrailingWhitespace.*;
+import static com.google.eclipse.protobuf.ui.preferences.editor.save.SaveActionsWritablePreferences.RemoveTrailingWhitespace.*;
 import static org.junit.Assert.assertEquals;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
 import org.junit.*;
 
-import com.google.eclipse.protobuf.junit.core.XtextRule;
 import com.google.eclipse.protobuf.junit.util.MultiLineTextBuilder;
-import com.google.eclipse.protobuf.ui.plugin.ProtobufEditorPlugIn;
-import com.google.eclipse.protobuf.ui.preferences.editor.save.SaveActionsTestPreferences;
+import com.google.eclipse.protobuf.ui.junit.XtextRule;
+import com.google.eclipse.protobuf.ui.preferences.editor.save.SaveActionsWritablePreferences;
 import com.google.eclipse.protobuf.ui.swtbot.ProtobufBot;
 import com.google.inject.Inject;
 
@@ -39,9 +37,9 @@
     editor = robot.createFile("test.proto");
   }
 
-  @Rule public XtextRule xtext = createWith(ProtobufEditorPlugIn.injector());
+  @Rule public XtextRule xtext = new XtextRule();
 
-  @Inject private SaveActionsTestPreferences preferences;
+  @Inject private SaveActionsWritablePreferences preferences;
 
   @Test public void should_remove_trailing_whitespace_in_edited_lines_only() {
     initEditor();
diff --git a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/junit/XtextRule.java b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/junit/XtextRule.java
new file mode 100644
index 0000000..f541dc2
--- /dev/null
+++ b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/junit/XtextRule.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.protobuf.ui.junit;
+
+import org.junit.rules.MethodRule;
+import org.junit.runners.model.*;
+
+import com.google.eclipse.protobuf.ui.plugin.ProtobufEditorPlugIn;
+import com.google.inject.Injector;
+
+/**
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+public class XtextRule implements MethodRule {
+  private final Injector injector;
+
+  public XtextRule() {
+    this.injector = ProtobufEditorPlugIn.injector();
+  }
+
+  @Override public Statement apply(Statement base, FrameworkMethod method, Object target) {
+    injector.injectMembers(target);
+    return base;
+  }
+}
diff --git a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/AbsractPreferencePageTestCase.java b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/AbsractPreferencePageTestCase.java
index fe0952f..974f478 100644
--- a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/AbsractPreferencePageTestCase.java
+++ b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/AbsractPreferencePageTestCase.java
@@ -8,13 +8,10 @@
  */
 package com.google.eclipse.protobuf.ui.preferences;
 
-import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-
 import org.eclipse.core.runtime.CoreException;
 import org.junit.*;
 
-import com.google.eclipse.protobuf.junit.core.XtextRule;
-import com.google.eclipse.protobuf.ui.plugin.ProtobufEditorPlugIn;
+import com.google.eclipse.protobuf.ui.junit.XtextRule;
 import com.google.eclipse.protobuf.ui.swtbot.ProtobufBot;
 
 /**
@@ -28,7 +25,7 @@
     robot.resetAll();
   }
 
-  @Rule public XtextRule xtext = createWith(ProtobufEditorPlugIn.injector());
+  @Rule public XtextRule xtext = new XtextRule();
 
   @Before public void restoreDefaults() {
     robot.button("Restore Defaults").click();
diff --git a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/editor/save/SaveActionsTestPreferences.java b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/editor/save/SaveActionsWritablePreferences.java
similarity index 90%
rename from com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/editor/save/SaveActionsTestPreferences.java
rename to com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/editor/save/SaveActionsWritablePreferences.java
index 4c1c34d..f782c80 100644
--- a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/editor/save/SaveActionsTestPreferences.java
+++ b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/preferences/editor/save/SaveActionsWritablePreferences.java
@@ -18,10 +18,10 @@
 /**
  * @author alruiz@google.com (Alex Ruiz)
  */
-public class SaveActionsTestPreferences {
+public class SaveActionsWritablePreferences {
   private final IPreferenceStore store;
 
-  @Inject public SaveActionsTestPreferences(IPreferenceStoreAccess storeAccess) {
+  @Inject public SaveActionsWritablePreferences(IPreferenceStoreAccess storeAccess) {
     store = storeAccess.getWritablePreferenceStore();
   }