@Test public void getImports_returns_empty_list_when_builder_is_empty() throws Exception { assertThat(new ImportListBuilder().getImports("com.acme")).isEmpty(); assertThat(new ImportListBuilder().getImports("")).isEmpty(); assertThat(new ImportListBuilder().getImports("acme")).isEmpty(); }
@Nonnull public List<DAImport> getImports(@Nonnull final String currentPackage) { checkNotNull(currentPackage, "currentPackage can not be null. Use the empty string for the default package"); if (imports.isEmpty()) { return Collections.emptyList(); } Map<DAName, List<DAImport>> indexBySimpleName = indexImportsBySimpleName(imports); return from(indexBySimpleName.values()) .transform(new ImportSelector(currentPackage)) .filter(Predicates.notNull()) .filter(FILTER_OUT_MAPPER_DEPENDENCY_ANNOTATION_IMPORT) .toList(); }
ImportListBuilder { @Nonnull public List<DAImport> getImports(@Nonnull final String currentPackage) { checkNotNull(currentPackage, "currentPackage can not be null. Use the empty string for the default package"); if (imports.isEmpty()) { return Collections.emptyList(); } Map<DAName, List<DAImport>> indexBySimpleName = indexImportsBySimpleName(imports); return from(indexBySimpleName.values()) .transform(new ImportSelector(currentPackage)) .filter(Predicates.notNull()) .filter(FILTER_OUT_MAPPER_DEPENDENCY_ANNOTATION_IMPORT) .toList(); } }
ImportListBuilder { @Nonnull public List<DAImport> getImports(@Nonnull final String currentPackage) { checkNotNull(currentPackage, "currentPackage can not be null. Use the empty string for the default package"); if (imports.isEmpty()) { return Collections.emptyList(); } Map<DAName, List<DAImport>> indexBySimpleName = indexImportsBySimpleName(imports); return from(indexBySimpleName.values()) .transform(new ImportSelector(currentPackage)) .filter(Predicates.notNull()) .filter(FILTER_OUT_MAPPER_DEPENDENCY_ANNOTATION_IMPORT) .toList(); }  }
ImportListBuilder { @Nonnull public List<DAImport> getImports(@Nonnull final String currentPackage) { checkNotNull(currentPackage, "currentPackage can not be null. Use the empty string for the default package"); if (imports.isEmpty()) { return Collections.emptyList(); } Map<DAName, List<DAImport>> indexBySimpleName = indexImportsBySimpleName(imports); return from(indexBySimpleName.values()) .transform(new ImportSelector(currentPackage)) .filter(Predicates.notNull()) .filter(FILTER_OUT_MAPPER_DEPENDENCY_ANNOTATION_IMPORT) .toList(); }  @Nonnull List<DAImport> getImports(@Nonnull final String currentPackage); }
ImportListBuilder { @Nonnull public List<DAImport> getImports(@Nonnull final String currentPackage) { checkNotNull(currentPackage, "currentPackage can not be null. Use the empty string for the default package"); if (imports.isEmpty()) { return Collections.emptyList(); } Map<DAName, List<DAImport>> indexBySimpleName = indexImportsBySimpleName(imports); return from(indexBySimpleName.values()) .transform(new ImportSelector(currentPackage)) .filter(Predicates.notNull()) .filter(FILTER_OUT_MAPPER_DEPENDENCY_ANNOTATION_IMPORT) .toList(); }  @Nonnull List<DAImport> getImports(@Nonnull final String currentPackage);  }