### Question:
UMethodInvocation extends UExpression implements MethodInvocationTree { public static UMethodInvocation create(UExpression methodSelect, List<UExpression> arguments) { return new AutoValue_UMethodInvocation(methodSelect, ImmutableList.copyOf(arguments)); }  static UMethodInvocation create(UExpression methodSelect, List<UExpression> arguments); static UMethodInvocation create(UExpression methodSelect, UExpression... arguments); @Override abstract UExpression getMethodSelect(); @Override abstract ImmutableList<UExpression> getArguments(); @Override @Nullable Choice<Unifier> visitMethodInvocation(
      MethodInvocationTree methodInvocation, @Nullable Unifier unifier); @Override R accept(TreeVisitor<R, D> visitor, D data); @Override Kind getKind(); @Override List<UTree<?>> getTypeArguments(); @Override JCMethodInvocation inline(Inliner inliner);  }### Answer:
@Test public void match() { UExpression fooIdent = mock(UExpression.class); when(fooIdent.unify(ident("foo"), isA(Unifier.class))).thenReturn(Choice.of(unifier)); ULiteral oneLit = ULiteral.intLit(1); ULiteral barLit = ULiteral.stringLit("bar"); UMethodInvocation invocation = UMethodInvocation.create(fooIdent, ImmutableList.<UExpression>of(oneLit, barLit)); assertUnifies("foo(1, \"bar\")", invocation); }
@Test public void equality() { UMethodType indexOfIntTy = UMethodType.create(UPrimitiveType.INT, UPrimitiveType.INT); UExpression fooLit = ULiteral.stringLit("foo"); UType isEmptyTy = UMethodType.create(UPrimitiveType.BOOLEAN, ImmutableList.<UType>of()); new EqualsTester() .addEqualityGroup( UMethodInvocation.create( UMemberSelect.create(fooLit, "indexOf", indexOfIntTy), ULiteral.charLit('a'))) .addEqualityGroup( UMethodInvocation.create( UMemberSelect.create(fooLit, "indexOf", indexOfIntTy), ULiteral.charLit('b'))) .addEqualityGroup( UMethodInvocation.create(UMemberSelect.create(fooLit, "isEmpty", isEmptyTy))) .testEquals(); }
@Test public void serialization() { SerializableTester.reserializeAndAssert( UMethodInvocation.create( UMemberSelect.create( ULiteral.stringLit("foo"), "indexOf", UMethodType.create(UPrimitiveType.INT, UPrimitiveType.INT)), ULiteral.charLit('a'))); }