@Test public void test8(){ Optional<Transaction> op = transactions.stream() .min((t1, t2) -> Integer.compare(t1.getValue(), t2.getValue())); System.out.println(op.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();  }