### Question:
AbstractCheckDescriptor { public boolean isRequired(UpgradeType upgradeType) { UpgradeType[] upgradeTypes = getClass().getAnnotation(UpgradeCheck.class).required(); for (UpgradeType requiredType : upgradeTypes) { if (upgradeType == requiredType) { return true; } } return false; } protected  AbstractCheckDescriptor(CheckDescription description); Set<String> getApplicableServices(); List<CheckQualification> getQualifications(); final boolean isApplicable(PrereqCheckRequest request); abstract void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request); CheckDescription getDescription(); PrereqCheckType getType(); boolean isRequired(UpgradeType upgradeType);  }### Answer:
@Test public void testRequired() throws Exception { RollingTestCheckImpl rollingCheck = new RollingTestCheckImpl(PrereqCheckType.SERVICE); Assert.assertTrue(rollingCheck.isRequired(UpgradeType.ROLLING)); Assert.assertFalse(rollingCheck.isRequired(UpgradeType.NON_ROLLING)); NotRequiredCheckTest notRequiredCheck = new NotRequiredCheckTest(PrereqCheckType.SERVICE); Assert.assertFalse(notRequiredCheck.isRequired(UpgradeType.ROLLING)); Assert.assertFalse(notRequiredCheck.isRequired(UpgradeType.NON_ROLLING)); Assert.assertFalse(notRequiredCheck.isRequired(UpgradeType.HOST_ORDERED)); TestCheckImpl requiredCheck = new TestCheckImpl(PrereqCheckType.SERVICE); Assert.assertTrue(requiredCheck.isRequired(UpgradeType.ROLLING)); Assert.assertTrue(requiredCheck.isRequired(UpgradeType.NON_ROLLING)); Assert.assertTrue(requiredCheck.isRequired(UpgradeType.HOST_ORDERED)); }