@Test public void entangleMethodShouldBePublic() { MethodSpec entangle = entanglingClass.createEntangleMethod(); assertThat(entangle.modifiers, hasItem(Modifier.PUBLIC)); }
@VisibleForTesting MethodSpec createEntangleMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC) .addParameter(TypeVariableName.get("T"), "target", FINAL); result.addStatement("this.target = target"); result.addStatement("quantum.Quantum.getTangle(id).addObserver(this)"); return result.build(); }
EntanglingClass { @VisibleForTesting MethodSpec createEntangleMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC) .addParameter(TypeVariableName.get("T"), "target", FINAL); result.addStatement("this.target = target"); result.addStatement("quantum.Quantum.getTangle(id).addObserver(this)"); return result.build(); } }
EntanglingClass { @VisibleForTesting MethodSpec createEntangleMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC) .addParameter(TypeVariableName.get("T"), "target", FINAL); result.addStatement("this.target = target"); result.addStatement("quantum.Quantum.getTangle(id).addObserver(this)"); return result.build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId); }
EntanglingClass { @VisibleForTesting MethodSpec createEntangleMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC) .addParameter(TypeVariableName.get("T"), "target", FINAL); result.addStatement("this.target = target"); result.addStatement("quantum.Quantum.getTangle(id).addObserver(this)"); return result.build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);  }
EntanglingClass { @VisibleForTesting MethodSpec createEntangleMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC) .addParameter(TypeVariableName.get("T"), "target", FINAL); result.addStatement("this.target = target"); result.addStatement("quantum.Quantum.getTangle(id).addObserver(this)"); return result.build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);   }