code: public static <T, A, B> Answer<T> toAnswer(final Answer2<T, A, B> answer) {
          return new Answer<T>() {
              @SuppressWarnings("unchecked")
              public T answer(InvocationOnMock invocation) throws Throwable {
                  return answer.answer(
                          (A)invocation.getArgument(0),
                          (B)invocation.getArgument(1));
              }
          };
      }
docs: Construct an answer from a two parameter answer interface
  @param answer answer interface
  @param <T> return type
  @param <A> input parameter 1 type
  @param <B> input parameter 2 type
  @return a new answer object