BidResponse extends UserResponse<BidResponse> { public final Iterable<Bid.Builder> bids() { return OpenRtbUtils.bids(openRtb()); } protected  BidResponse(Exchange exchange, HttpResponse.Builder httpResponseBuilder); static Builder newBuilder(); @Override Builder toBuilder(); final OpenRtb.BidResponse.Builder openRtb(); final T nativeResponse(); final ResponseMode getResponseMode(); final SeatBid.Builder seatBid(String seat); final SeatBid.Builder seatBid(); final BidResponse addBid(BidOrBuilder bid); final BidResponse addBid(String seat, BidOrBuilder bid); final Iterable<Bid.Builder> bids(); final List<Bid.Builder> bids(@Nullable String seat); final @Nullable Bid.Builder bidWithId(String id); final @Nullable Bid.Builder bidWithId(@Nullable String seat, String id); final @Nullable Bid.Builder bidWithAdid(String adid); final @Nullable Bid.Builder bidWithAdid(@Nullable String seat, String adid); final Iterable<Bid.Builder> bidsWith(Predicate<Bid.Builder> filter); final Iterable<Bid.Builder> bidsWith(
      @Nullable String seat, Predicate<Bid.Builder> filter); final boolean updateBids(Function<Bid.Builder, Boolean> updater); final boolean updateBids(@Nullable String seat, Function<Bid.Builder, Boolean> updater); final boolean filterBids(Predicate<Bid.Builder> filter); final boolean filterBids(@Nullable String seat, Predicate<Bid.Builder> filter); @Override ToStringHelper toStringHelper();  }
@Test public void testBids() { BidResponse response = TestBidResponseBuilder.create().build(); response.addBid(Bid.newBuilder().setId("1").buildPartial()); response.addBid("x", Bid.newBuilder().setId("2").buildPartial()); assertEquals(2, Iterables.size(response.bids())); assertEquals(1, response.bids("x").size()); assertNotNull(response.bidWithId("1")); assertNotNull(response.bidWithId("x", "2")); assertNull(response.bidWithId("none")); assertNull(response.bidWithId("x", "none")); assertFalse(Iterables.isEmpty(response.bidsWith(new Predicate<Bid.Builder>() { @Override public boolean apply(Bid.Builder bid) { return "1".equals(bid.getId()); }}))); assertFalse(Iterables.isEmpty(response.bidsWith("x", new Predicate<Bid.Builder>() { @Override public boolean apply(Bid.Builder bid) { return "2".equals(bid.getId()); }}))); assertTrue(Iterables.isEmpty(response.bidsWith(Predicates.<Bid.Builder>alwaysFalse()))); assertTrue(Iterables.isEmpty(response.bidsWith("x", Predicates.<Bid.Builder>alwaysFalse()))); assertTrue(Iterables.isEmpty(response.bidsWith("none", Predicates.<Bid.Builder>alwaysFalse()))); }