England captain Alastair Cook warmed-up for the one-day international series against Sri Lanka with 71 against the tourists as Essex won their rain-affected match at Chelmsford.
After bad weather cut the 50 overs match short to 21 overs per side, Cook notched his total off just 49 balls, including two sixes and four fours, while Ben Foakes also hit 51 as Essex reached 161-5.
In reply, Sri Lanka hit 146-9, with Oliver Newby the pick of the bowlers taking 3-36, as Essex won by 22 runs using the Duckworth-Lewis method to condemn the tourists to defeat in their first match on English soil this summer.
Sri Lanka won the toss and elected to bowl but only managed to get two overs in, at a cost of three runs, before rain washed out the rest of the afternoon.
Cook and Mark Pettini returned to the crease at 7.15pm, adding another 10 runs before Pettini (eight) edged to Thisara Perera at third slip off Suranga Lakmal.
Cook hit a boundary and a couple of singles before Lakmal bowled Greg Smith (one) and Ravi Bopara fell lbw to Dhammika Prasad for a duck to leave Essex reeling on 21-3.
Foakes combined with Cook to steady the ship, with the score a much more respectable 103-4 when the 21-year-old was caught by Ashan Priyanjan off Tillakaratne Dilshan for 51 off 31 balls.
Cook's impressive knock ended when he was caught by Lakmal off Prasad before James Foster (12 not out) and Tom Westley (16no) provided late runs.
Sri Lanka's pursuit got off to a rocky start as Newby took the wickets of Kusal Perera, lbw for four, and Mahela Jayawardene, who was caught by Foakes for six, to leave Sri Lanka on 31-2.
Monty Panesar bowled Dilshan (22) and Smith removed Lahiru Thirimanne (five) soon after to leave Sri Lanka struggling on 44-4.
Angelo Mathews (19) was Smith's next victim after a 23-run partnership with Dinesh Chandimal, leaving the visitors on 77-5 with time running out.
Thisara Perera (13) skied a Reece Topley delivery to Foakes before Chandimal (31) finally fell when Panesar took a steepling catch off Newby, with Sri Lanka needing 51 off four overs.
Any lingering hopes they had of a fightback were dashed when Ashan Priyanjan (10) was trapped lbw by Panesar and Prasad (one) fell six balls later to leave Sri Lanka chasing 40 runs with only one wicket and 11 balls remaining.
Chaturanga de Silva hit two quick sixes off Newby to make it 146-9 but the bowler recovered to see out the 22-run victory for Essex.