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;
Experience pair programming with AI  Get Codota for Java