@Test public void detangleMethodShouldHaveOnlyOneModifier() { MethodSpec detangle = entanglingClass.createDetangleMethod(); assertThat(detangle.modifiers, hasSize(1)); }
@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);   }