@Test void computeApplicableFlagsShouldReturnOnlyDefaultApplicableFlagWhenNoMessageWithUserCustomFlag() { List<MailboxMessage> mailboxMessages = ImmutableList.of( createMessage(new Flags(Flag.ANSWERED)), createMessage(new Flags(Flag.DELETED)), createMessage(new Flags(Flag.USER)), createMessage(new Flags(Flag.RECENT))); ApplicableFlagCalculator calculator = new ApplicableFlagCalculator(mailboxMessages); assertThat(calculator.computeApplicableFlags()).isEqualTo(getDefaultApplicableFlag()); }
public Flags computeApplicableFlags() { return ApplicableFlagBuilder.builder() .add(Iterators.toStream(mailboxMessages.iterator()) .map(MailboxMessage::createFlags) .collect(Guavate.toImmutableList())) .build(); }
ApplicableFlagCalculator { public Flags computeApplicableFlags() { return ApplicableFlagBuilder.builder() .add(Iterators.toStream(mailboxMessages.iterator()) .map(MailboxMessage::createFlags) .collect(Guavate.toImmutableList())) .build(); } }
ApplicableFlagCalculator { public Flags computeApplicableFlags() { return ApplicableFlagBuilder.builder() .add(Iterators.toStream(mailboxMessages.iterator()) .map(MailboxMessage::createFlags) .collect(Guavate.toImmutableList())) .build(); } ApplicableFlagCalculator(Iterable<MailboxMessage> mailboxMessages); }
ApplicableFlagCalculator { public Flags computeApplicableFlags() { return ApplicableFlagBuilder.builder() .add(Iterators.toStream(mailboxMessages.iterator()) .map(MailboxMessage::createFlags) .collect(Guavate.toImmutableList())) .build(); } ApplicableFlagCalculator(Iterable<MailboxMessage> mailboxMessages); Flags computeApplicableFlags(); }
ApplicableFlagCalculator { public Flags computeApplicableFlags() { return ApplicableFlagBuilder.builder() .add(Iterators.toStream(mailboxMessages.iterator()) .map(MailboxMessage::createFlags) .collect(Guavate.toImmutableList())) .build(); } ApplicableFlagCalculator(Iterable<MailboxMessage> mailboxMessages); Flags computeApplicableFlags();  }