@Test public void detangleMethodCodeShouldDeleteObservers() { MethodSpec method = entanglingClass.createDetangleMethod(); assertThat(method.code.toString(), is("quantum.Quantum.getTangle(id).deleteObservers();\n")); }
@VisibleForTesting MethodSpec createDetangleMethod() { return MethodSpec.methodBuilder("detangle") .addModifiers(PUBLIC) .addStatement("quantum.Quantum.getTangle(id).deleteObservers()") .build(); }
EntanglingClass { @VisibleForTesting MethodSpec createDetangleMethod() { return MethodSpec.methodBuilder("detangle") .addModifiers(PUBLIC) .addStatement("quantum.Quantum.getTangle(id).deleteObservers()") .build(); } }
EntanglingClass { @VisibleForTesting MethodSpec createDetangleMethod() { return MethodSpec.methodBuilder("detangle") .addModifiers(PUBLIC) .addStatement("quantum.Quantum.getTangle(id).deleteObservers()") .build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId); }
EntanglingClass { @VisibleForTesting MethodSpec createDetangleMethod() { return MethodSpec.methodBuilder("detangle") .addModifiers(PUBLIC) .addStatement("quantum.Quantum.getTangle(id).deleteObservers()") .build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);  }
EntanglingClass { @VisibleForTesting MethodSpec createDetangleMethod() { return MethodSpec.methodBuilder("detangle") .addModifiers(PUBLIC) .addStatement("quantum.Quantum.getTangle(id).deleteObservers()") .build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);   }