AutocompletePredictionBuffer implements Result, DataBuffer<AutocompletePrediction> { @Override public int getCount() { if (predictions == null) { return 0; } return predictions.size(); } AutocompletePredictionBuffer(@NonNull Status status,
      @Nullable List<AutocompletePrediction> predictions); @NonNull @Override Status getStatus(); @Override int getCount(); @Nullable @Override AutocompletePrediction get(int index);  }
@Test public void getCount_shouldReturnCorrectCount() { int count = buffer.getCount(); assertThat(count).isEqualTo(1); }
@Test public void getCount_shouldReturnCorrectCount_nullPredictions() { buffer = new AutocompletePredictionBuffer(status, null); int count = buffer.getCount(); assertThat(count).isEqualTo(0); }