### Question:
Datastore { public BeginTransactionResponse beginTransaction(BeginTransactionRequest request) throws DatastoreException { try (InputStream is = remoteRpc.call("beginTransaction", request)) { return BeginTransactionResponse.parseFrom(is); } catch (IOException exception) { throw invalidResponseException("beginTransaction", exception); } } Datastore(RemoteRpc remoteRpc); void resetRpcCount(); int getRpcCount(); AllocateIdsResponse allocateIds(AllocateIdsRequest request); BeginTransactionResponse beginTransaction(BeginTransactionRequest request); CommitResponse commit(CommitRequest request); LookupResponse lookup(LookupRequest request); ReserveIdsResponse reserveIds(ReserveIdsRequest request); RollbackResponse rollback(RollbackRequest request); RunQueryResponse runQuery(RunQueryRequest request);  }### Answer:
@Test public void beginTransaction() throws Exception { BeginTransactionRequest.Builder request = BeginTransactionRequest.newBuilder(); BeginTransactionResponse.Builder response = BeginTransactionResponse.newBuilder(); response.setTransaction(ByteString.copyFromUtf8("project-id")); expectRpc("beginTransaction", request.build(), response.build()); }