@Test public void test4(){ transactions.stream() .map((t) -> t.getTrader().getName()) .sorted() .forEach(System.out::println); System.out.println("------------------------------------"); String str = transactions.stream() .map((t) -> t.getTrader().getName()) .sorted() .reduce("", String::concat); System.out.println(str); System.out.println("------------------------------------"); transactions.stream() .map((t) -> t.getTrader().getName()) .flatMap(TestTransaction::filterCharacter) .sorted((s1, s2) -> s1.compareToIgnoreCase(s2)) .forEach(System.out::print); }
public Trader getTrader() { return trader; }
Transaction { public Trader getTrader() { return trader; } }
Transaction { public Trader getTrader() { return trader; } Transaction();  Transaction(Trader trader, int year, int value); }
Transaction { public Trader getTrader() { return trader; } Transaction();  Transaction(Trader trader, int year, int value); Trader getTrader(); void setTrader(Trader trader); int getYear(); void setYear(int year); int getValue(); void setValue(int value); @Override String toString(); }
Transaction { public Trader getTrader() { return trader; } Transaction();  Transaction(Trader trader, int year, int value); Trader getTrader(); void setTrader(Trader trader); int getYear(); void setYear(int year); int getValue(); void setValue(int value); @Override String toString();  }