HaloCore { @NonNull public List<HaloSegmentationTag> segmentationTags() { StringBuilder builder = new StringBuilder("\n"); builder.append("-------------------- USER TAGS --------------------\n"); List<HaloSegmentationTag> segmentationTags = new ArrayList<>(mTagCollectors.size()); for (TagCollector collector : mTagCollectors) { HaloSegmentationTag tag = collector.collect(mFramework.context()); if (tag != null) { builder.append(tag.toString()).append("\n"); segmentationTags.add(tag); } } builder.append("-------------------- USER TAGS --------------------\n"); Halog.d(getClass(), builder.toString()); return segmentationTags; } HaloCore(@NonNull HaloFramework framework,
                    @NonNull HaloManagerApi managerApi,
                    @NonNull HaloSessionManager sessionManager,
                    @Nullable Credentials credentials,
                    @Nullable List<TagCollector> tagCollectors); @Keep @Api(1.3) @NonNull HaloSessionManager sessionManager(); @Keep @Api(1.3) boolean debug(); @Keep @NonNull Credentials credentials(); @Keep @Api(1.3) void credentials(@NonNull Credentials credentials); @Keep @Api(1.3) void logout(); @Keep @Api(1.3) @NonNull String version(); @Keep @Api(1.3) void flushSession(); @Keep @Api(2.1) void haloAuthRecover(@NonNull AuthenticationRecover authenticationRecover); @Nullable @Keep @Api(2.1) AuthenticationRecover haloAuthRecover(); @Keep @Api(1.3) @NonNull HaloFramework framework(); @Keep @Api(2.0) @NonNull HaloManagerApi manager(); @Keep @Api(1.3) @NonNull List<TagCollector> tagCollectors(); @HaloServerVersion.VersionCheck int serverVersionCheck(); void serverVersionCheck(@Nullable HaloServerVersion version); @NonNull List<HaloSegmentationTag> segmentationTags(); @Keep @Api(1.3) boolean isVersionValid();  }
@Test public void thatSegmentationTagsAreEmpty() { HaloCore core = HaloMock.createCore(Credentials.createClient("myClient", "myPass"), new ArrayList<TagCollector>()); assertThat(core.segmentationTags().size()).isEqualTo(0); }
@Test public void thatSegmentationTagsExists() { List<TagCollector> collectors = new ArrayList<>(); collectors.add(new DeviceModelCollector()); collectors.add(new DeviceManufacturerCollector()); HaloCore core = HaloMock.createCore(Credentials.createClient("myClient", "myPass"), collectors); assertThat(core.segmentationTags().size()).isEqualTo(2); }