MemberProgramPoint implements ProgramPoint { public static boolean originatesFrom(Tree element) { return element.is(Tree.Kind.BRACKET_MEMBER_EXPRESSION, Tree.Kind.DOT_MEMBER_EXPRESSION); } MemberProgramPoint(Tree element); static boolean originatesFrom(Tree element); @Override Optional<ProgramState> execute(final ProgramState state); Optional<ProgramState> executeStrictMode(final  ProgramState state);  }
@Test public void matchingTrees() throws Exception { assertThat(MemberProgramPoint.originatesFrom(tree(Tree.Kind.DOT_MEMBER_EXPRESSION))).isTrue(); assertThat(MemberProgramPoint.originatesFrom(tree(Tree.Kind.BRACKET_MEMBER_EXPRESSION))).isTrue(); assertThat(MemberProgramPoint.originatesFrom(tree(Tree.Kind.FOR_OF_STATEMENT))).isFalse(); assertThat(MemberProgramPoint.originatesFrom(tree(Tree.Kind.AND_ASSIGNMENT))).isFalse(); }