So, you have two Date objects, let's say date1 and date2, where date1 is before date2, and you want to know if the time between them is less than one year.
One way to do this with Java's standard date and time API is like this:
Get a Calendar object and set it to the value of date2.
Use Calendar's methods to subtract one year.
Check if the date that the calendar is set to is before date1. If this is true, then the time between date1 and date2 is less than one year.