@Test public void scanForSagas_defaultCtor_doesNotReturnAbstractBaseClass() { ReflectionsTypeScanner sut = new ReflectionsTypeScanner(); Collection<Class<? extends Saga>> foundSagas = sut.scanForSagas(); assertThat("Expected not to find AbstractSaga in returned list.", foundSagas, not(hasItem(AbstractSaga.class))); }
@Override public Collection<Class<? extends Saga>> scanForSagas() { Set<Class<? extends Saga>> sagaTypes = reflections.getSubTypesOf(Saga.class); Set<Class<? extends AbstractSaga>> abstractSagaTypes = reflections.getSubTypesOf(AbstractSaga.class); Set<Class<? extends AbstractSingleEventSaga>> singleEventSagaTypes = reflections.getSubTypesOf(AbstractSingleEventSaga.class); Set<Class<? extends Saga>> foundTypes = Sets.union(sagaTypes, abstractSagaTypes); Set<Class<? extends Saga>> mergedSet = Sets.union(foundTypes, copy(singleEventSagaTypes)); return removeAbstractTypes(mergedSet); }
ReflectionsTypeScanner implements TypeScanner { @Override public Collection<Class<? extends Saga>> scanForSagas() { Set<Class<? extends Saga>> sagaTypes = reflections.getSubTypesOf(Saga.class); Set<Class<? extends AbstractSaga>> abstractSagaTypes = reflections.getSubTypesOf(AbstractSaga.class); Set<Class<? extends AbstractSingleEventSaga>> singleEventSagaTypes = reflections.getSubTypesOf(AbstractSingleEventSaga.class); Set<Class<? extends Saga>> foundTypes = Sets.union(sagaTypes, abstractSagaTypes); Set<Class<? extends Saga>> mergedSet = Sets.union(foundTypes, copy(singleEventSagaTypes)); return removeAbstractTypes(mergedSet); } }
ReflectionsTypeScanner implements TypeScanner { @Override public Collection<Class<? extends Saga>> scanForSagas() { Set<Class<? extends Saga>> sagaTypes = reflections.getSubTypesOf(Saga.class); Set<Class<? extends AbstractSaga>> abstractSagaTypes = reflections.getSubTypesOf(AbstractSaga.class); Set<Class<? extends AbstractSingleEventSaga>> singleEventSagaTypes = reflections.getSubTypesOf(AbstractSingleEventSaga.class); Set<Class<? extends Saga>> foundTypes = Sets.union(sagaTypes, abstractSagaTypes); Set<Class<? extends Saga>> mergedSet = Sets.union(foundTypes, copy(singleEventSagaTypes)); return removeAbstractTypes(mergedSet); } ReflectionsTypeScanner();  ReflectionsTypeScanner(final Reflections reflections); }
ReflectionsTypeScanner implements TypeScanner { @Override public Collection<Class<? extends Saga>> scanForSagas() { Set<Class<? extends Saga>> sagaTypes = reflections.getSubTypesOf(Saga.class); Set<Class<? extends AbstractSaga>> abstractSagaTypes = reflections.getSubTypesOf(AbstractSaga.class); Set<Class<? extends AbstractSingleEventSaga>> singleEventSagaTypes = reflections.getSubTypesOf(AbstractSingleEventSaga.class); Set<Class<? extends Saga>> foundTypes = Sets.union(sagaTypes, abstractSagaTypes); Set<Class<? extends Saga>> mergedSet = Sets.union(foundTypes, copy(singleEventSagaTypes)); return removeAbstractTypes(mergedSet); } ReflectionsTypeScanner();  ReflectionsTypeScanner(final Reflections reflections); @Override Collection<Class<? extends Saga>> scanForSagas(); }
ReflectionsTypeScanner implements TypeScanner { @Override public Collection<Class<? extends Saga>> scanForSagas() { Set<Class<? extends Saga>> sagaTypes = reflections.getSubTypesOf(Saga.class); Set<Class<? extends AbstractSaga>> abstractSagaTypes = reflections.getSubTypesOf(AbstractSaga.class); Set<Class<? extends AbstractSingleEventSaga>> singleEventSagaTypes = reflections.getSubTypesOf(AbstractSingleEventSaga.class); Set<Class<? extends Saga>> foundTypes = Sets.union(sagaTypes, abstractSagaTypes); Set<Class<? extends Saga>> mergedSet = Sets.union(foundTypes, copy(singleEventSagaTypes)); return removeAbstractTypes(mergedSet); } ReflectionsTypeScanner();  ReflectionsTypeScanner(final Reflections reflections); @Override Collection<Class<? extends Saga>> scanForSagas();  }