.withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis()));
((AWSResource) resource).setAWSResourceState("completed");
Date oldTermDate = new Date(now.plusDays(10).getMillis());
String oldTermReason = "Foo";
int retentionDays = 4;
NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(),
ageThreshold, retentionDays);
resource.setExpectedTerminationTime(oldTermDate);
resource.setTerminationReason(oldTermReason);
Assert.assertFalse(rule.isValid(resource));
Assert.assertEquals(oldTermDate, resource.getExpectedTerminationTime());