DimensionQueue { private TrackMe onTrack(TrackMe trackMe) { for (Iterator<CustomDimension> it = mOneTimeDimensions.iterator(); it.hasNext(); ) { CustomDimension dim = it.next(); String existing = CustomDimension.getDimension(trackMe, dim.getId()); if (existing != null) { Timber.tag(TAG).d("Setting dimension %s to slot %d would overwrite %s, skipping!", dim.getValue(), dim.getId(), existing); } else { CustomDimension.setDimension(trackMe, dim); it.remove(); } } return trackMe; } DimensionQueue(Tracker tracker); void add(int id, String value);  }
@Test public void testEmpty() { new DimensionQueue(mTracker); verify(mTracker).addTrackingCallback(mCaptor.capture()); TrackMe pre = new TrackMe(); TrackMe post = mCaptor.getValue().onTrack(pre); assertThat(post, notNullValue()); assertThat(pre, is(post)); }