Code example for Future

Methods: get

0
	@Test 
	public void testmultiply() throws InterruptedException, ExecutionException { 
		Future<Integer> res = null;
		res = myMathService.multiply(1,15);
		try { 
			assertEquals(15,res.get());
		} 
		catch (InterruptedException e) {
			e.printStackTrace();
		} catch (ExecutionException e) {
			e.printStackTrace();
		} 
	} 
 
	@Test 
	public void testsubtractNeg() { 
		assertEquals(-1,myMathService.subtract(14,15));
	} 
 
 
}