AdConverterMoment implements AdConverter<Moment> { @Override public Moment make(Advertisement descriptor) { if (mMoments == null) { throw new IllegalStateException("Must have a list to modify."); } Id id = Id.fromAdId(descriptor.getId()); if (mRemoteMomentCache.containsKey(id)) { return mRemoteMomentCache.get(id); } final Moment moment = mMomentFactory.fromAttributes(id, nextOrdinal(), descriptor.getAttributes()); mRemoteMomentCache.put(id, moment); List<String> addresses = descriptor.getAddresses(); if (addresses.isEmpty()) { throw new IllegalStateException("No addresses."); } String name = "/" + addresses.get(0); final MomentIfcClient client = mClientFactory.makeClient(name); mExecutor.submit( new Runnable() { @Override public void run() { getThumbImage(client, moment); if (mDoFullSizeToo) { getFullImage(client, moment); } } }); return moment; } AdConverterMoment(
            V23Manager v23Manager,
            MomentFactory factory,
            ExecutorService executor,
            Handler handler,
            Map<Id, Moment> remoteMomentCache,
            MomentClientFactory clientFactory,
            boolean doFullSizeToo);  AdConverterMoment(
            V23Manager v23Manager,
            MomentFactory factory,
            ExecutorService executor,
            Handler handler,
            Map<Id, Moment> remoteMomentCache); void setList(ObservedList<Moment> moments); @Override Moment make(Advertisement descriptor);  }
@Test public void makeWithoutObservedListThrowsException() { mThrown.expect(IllegalStateException.class); mThrown.expectMessage("Must have a list to modify."); mConverter.make(mAdvertisement); }