Here you can find the source of getComingTime(Integer delta, TimeUnit unit)
public static Date getComingTime(Integer delta, TimeUnit unit)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static Date getComingTime(Integer delta, TimeUnit unit) { Calendar cal = Calendar.getInstance(); long base = cal.getTimeInMillis(); long d = unit.toMillis(delta); cal.setTimeInMillis(base + d);// w w w . j av a 2 s. c o m return cal.getTime(); } }