*/
if (Matchers.<MethodTree>hasModifier(Modifier.STATIC).matches(methodTree, state)) {
CharSequence methodSource = state.getSourceForNode((JCMethodDecl) methodTree);
if (methodSource != null) {
String methodString = "@Test\n" + methodSource.toString().replaceFirst(" static ", " ");
Fix fix = SuggestedFix.builder()
.addImport(JUNIT4_TEST_ANNOTATION)
.replace(methodTree, methodString)
.build();
return describeMatch(methodTree, fix);
}
}
Fix fix = SuggestedFix.builder()
.addImport(JUNIT4_TEST_ANNOTATION)
.prefixWith(methodTree, "@Test\n")
.build();
return describeMatch(methodTree, fix);
}