Code example for TreeSet

    private Context mContext;
    private AlarmManager mAlarmManager;
    // runnable --> time to execute in SystemClock 
    private TreeSet<MyEvent> mEventQueue =
            new TreeSet<MyEvent>(new MyEventComparator());
    private PendingIntent mPendingIntent;
    private Executor mExecutor;
    public SipWakeupTimer(Context context, Executor executor) {
        mContext = context;
        mAlarmManager = (AlarmManager)
        IntentFilter filter = new IntentFilter(getAction());
        context.registerReceiver(this, filter);
        mExecutor = executor;
Stop searching for code, let great code find you!  Add Codota to your java IDE