@Override
  public boolean matches(ExpressionTree expressionTree, VisitorState state) {
    if (expressionTree instanceof LiteralTree) {
      LiteralTree literalTree = (LiteralTree) expressionTree;
      Object actualValue = literalTree.getValue();
      return actualValue instanceof String && matcher.test((String) actualValue);
    } else {
      return false;
    }
  }
@Test
  public void notMatches() {
    // TODO(b/67738557): consolidate helpers for creating fake trees
    LiteralTree tree =
        new LiteralTree() {

          @Override
          public Kind getKind() {
            throw new UnsupportedOperationException();
          }

          @Override
          public <R, D> R accept(TreeVisitor<R, D> visitor, D data) {
            throw new UnsupportedOperationException();
          }

          @Override
          public Object getValue() {
            return "a string literal";
          }
        };
    assertThat(new StringLiteral("different string").matches(tree, null)).isFalse();

    IdentifierTree idTree =
        new IdentifierTree() {
          @Override
          public Name getName() {
            return null;
          }

          @Override
          public Kind getKind() {
            throw new UnsupportedOperationException();
          }

          @Override
          public <R, D> R accept(TreeVisitor<R, D> visitor, D data) {
            throw new UnsupportedOperationException();
          }
        };
    assertThat(new StringLiteral("test").matches(idTree, null)).isFalse();

    // TODO(b/67738557): consolidate helpers for creating fake trees
    LiteralTree intTree =
        new LiteralTree() {
          @Override
          public Object getValue() {
            return 5;
          }

          @Override
          public Kind getKind() {
            throw new UnsupportedOperationException();
          }

          @Override
          public <R, D> R accept(TreeVisitor<R, D> visitor, D data) {
            throw new UnsupportedOperationException();
          }
        };
    assertThat(new StringLiteral("test").matches(intTree, null)).isFalse();
  }