public static boolean isYesterday(Date date) {
        Calendar c1 = Calendar.getInstance(); // today
        c1.add(Calendar.DAY_OF_YEAR, -1); // yesterday

        Calendar c2 = Calendar.getInstance();
        c2.setTime(date); // your date

        return c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR)
                && c1.get(Calendar.DAY_OF_YEAR) == c2.get(Calendar.DAY_OF_YEAR);
    }
Created by Nick@NewStand.org on 2017/3/26 17:00
E-Mail: NewStand@163.com
All right reserved.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/DateUtils.java