@Test public void test7(){ Optional<Integer> max = transactions.stream() .map((t) -> t.getValue()) .max(Integer::compare); System.out.println(max.get()); }
public int getValue() { return value; }
Transaction { public int getValue() { return value; } }
Transaction { public int getValue() { return value; } Transaction();  Transaction(Trader trader, int year, int value); }
Transaction { public int getValue() { return value; } 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 int getValue() { return value; } 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();  }