### Question:
TPMPolicy extends Policy implements HasBaselines { public void setReportPcrMask(final int mask) { if ((mask & ~ALL_PCR_MASK) != 0) { String msg = "invalid PCR mask -- bit(s) outside range 0-23 set: " + Integer.toHexString(mask & ~ALL_PCR_MASK); LOGGER.error(msg); throw new IllegalArgumentException(msg); } if (mask == 0) { String msg = "Invalid PCR Mask of 0. At least one PCR must be" + "reported on in a given policy."; LOGGER.error(msg); throw new IllegalArgumentException(msg); } this.reportPCRs = mask; } TPMPolicy(final String name);  TPMPolicy(final String name, final String description); protected  TPMPolicy(); void setTpmWhiteListBaseline(final TpmWhiteListBaseline baseline); void setTpmBlackListBaseline(final TpmBlackListBaseline baseline); void setTpmWhiteListBaselines(final Collection<TpmWhiteListBaseline> baselines); void setTpmBlackListBaselines(
            final Collection<TpmBlackListBaseline> blackListBaselines); Collection<TpmWhiteListBaseline> getTpmWhiteListBaselines(); List<TpmBlackListBaseline> getTpmBlackListBaselines(); Set<Integer> getDeviceSpecificPCRs(); boolean isInDeviceSpecificPCRs(final int pcrId); void addToDeviceSpecificPCRs(final int pcrId); boolean removeFromDeviceSpecificPCRs(final int pcrId); void clearDeviceSpecificPCRs(); void setReportPcrMask(final int mask); int getReportPcrMask(); boolean isPcrReported(final int pcrId); void setAppraisePcrMask(final int mask); int getAppraisePcrMask(); boolean isKernelPcrSelected(final int pcrId); void setKernelPcrMask(final int mask); int getKernelPcrMask(); boolean isPcrAppraised(final int pcrId); void setPcrAppraised(final int pcrId); void setPcrNotAppraised(final int pcrId); void setDefaultPcrAppraisalValues(); void clearAllPcrAppraisalValues(); void setAppraiseFullReport(final boolean flag); boolean isAppraiseFullReport(); void setValidateSignature(final boolean flag); boolean isValidateSignature(); void setDetectKernelUpdate(final boolean flag); boolean isDetectKernelUpdateEnabled(); void setAlertOnKernelUpdate(final boolean flag); boolean isAlertOnKernelUpdateEnabled(); AlertSeverity getKernelUpdateAlertSeverity(); void setKernelUpdateAlertSeverity(final AlertSeverity severity); @Override List<Baseline> getBaselines(); String getKernelPcrListForOutput(); List<Integer> getKernelPcrList(); static String serializeKernelPcrList(final TPMPolicy tpmPolicy); static boolean isKernelPcrSelected(final TPMPolicy tpmPolicy, final int pcrId); static int calculatePcrMask(final Iterable<Integer> pcrIdSet); static final int ALL_PCR_MASK; static final List<Integer> DEFAULT_DEVICE_SPECIFIC_PCRS; }### Answer:
@Test public final void setReportPcrMask() { TPMPolicy tpmPolicy = new TPMPolicy("TestTPMPolicy"); tpmPolicy.setReportPcrMask(TPMPolicy.ALL_PCR_MASK); Assert.assertEquals(tpmPolicy.getReportPcrMask(), TPMPolicy.ALL_PCR_MASK); }
@Test(expectedExceptions = IllegalArgumentException.class) public final void setInvalidReportMask() { TPMPolicy tpmPolicy = new TPMPolicy("TestTPMPolicy"); tpmPolicy.setReportPcrMask(INVALID_PCR_MASK); }
@Test(expectedExceptions = IllegalArgumentException.class) public final void setZeroedReportMask() { TPMPolicy tpmPolicy = new TPMPolicy("TestTPMPolicy"); tpmPolicy.setReportPcrMask(0); }