@Test void is_getter_if_has_one_return_statement() { assertThat(isAccessor("class T { private boolean a; public boolean isA() { a=!a;return a; } }")).isFalse(); assertThat(isAccessor("class T { private int a; public int getA() { a++;return a; } }")).isFalse(); assertThat(isAccessor("class T { private boolean a; public boolean isA() { return a; } }")).isTrue(); assertThat(isAccessor("class T { private int a; public int getA() { return a; } }")).isTrue(); assertThat(isAccessor("class T { private int a; public void getA() { a++; } }")).isFalse(); }
public static boolean isAccessor(ClassTree classTree, MethodTree methodTree) { return isPublicMethod(methodTree) && methodTree.block() != null && (isGetter(classTree, methodTree) || isSetter(classTree, methodTree)); }
AccessorsUtils { public static boolean isAccessor(ClassTree classTree, MethodTree methodTree) { return isPublicMethod(methodTree) && methodTree.block() != null && (isGetter(classTree, methodTree) || isSetter(classTree, methodTree)); } }
AccessorsUtils { public static boolean isAccessor(ClassTree classTree, MethodTree methodTree) { return isPublicMethod(methodTree) && methodTree.block() != null && (isGetter(classTree, methodTree) || isSetter(classTree, methodTree)); } private  AccessorsUtils(); }
AccessorsUtils { public static boolean isAccessor(ClassTree classTree, MethodTree methodTree) { return isPublicMethod(methodTree) && methodTree.block() != null && (isGetter(classTree, methodTree) || isSetter(classTree, methodTree)); } private  AccessorsUtils(); static boolean isAccessor(ClassTree classTree, MethodTree methodTree); }
AccessorsUtils { public static boolean isAccessor(ClassTree classTree, MethodTree methodTree) { return isPublicMethod(methodTree) && methodTree.block() != null && (isGetter(classTree, methodTree) || isSetter(classTree, methodTree)); } private  AccessorsUtils(); static boolean isAccessor(ClassTree classTree, MethodTree methodTree);  }