### Question:
Capability { public Capability(String fileId, int accessMode, int validity, long expires, String clientIdentity, int epochNo, boolean replicateOnClose, SnapConfig snapConfig, long snapTimestamp, String sharedSecret) { this(fileId, accessMode, validity, expires, clientIdentity, epochNo, replicateOnClose, snapConfig, snapTimestamp, false, "", "", QuotaConstants.UNLIMITED_VOUCHER, 0L, sharedSecret); } Capability(String fileId, int accessMode, int validity, long expires, String clientIdentity,
                      int epochNo, boolean replicateOnClose, SnapConfig snapConfig, long snapTimestamp, String sharedSecret);  Capability(String fileId, int accessMode, int validity, long expires, String clientIdentity,
        int epochNo, boolean replicateOnClose, SnapConfig snapConfig, long snapTimestamp, boolean traceRequests,
        String tracingPolicy, String tracingPolicyConfig, long voucherSize, long expireMS, String sharedSecret);  Capability(String fileId, int accessMode, int validity, long expires, String clientIdentity, int epochNo,
            boolean replicateOnClose, SnapConfig snapConfig, long snapTimestamp, long voucherSize, long expireMS,
            String sharedSecret);  Capability(XCap xcap, String sharedSecret); XCap getXCap(); String getFileId(); int getAccessMode(); long getExpires(); String getClientIdentity(); int getEpochNo(); String getSignature(); boolean isValid(); boolean hasExpired(); boolean hasValidSignature(); boolean isReplicateOnClose(); SnapConfig getSnapConfig(); long getSnapTimestamp(); TraceConfig getTraceConfig(); long getVoucherSize(); long getExpireMs(); @Override String toString();  }### Answer:
@Test public void testCapability() throws Exception { Capability cap = new Capability("1254" + ((HashStorageLayout.WIN) ? ":" : "_") + "AB", 1, 60, System.currentTimeMillis() / 1000 + 100, "", 1, false, SnapConfig.SNAP_CONFIG_SNAPS_DISABLED, 0, SECRET); assertTrue(cap.isValid()); assertEquals(cap.getFileId(), "1254" + ((HashStorageLayout.WIN) ? ":" : "_") + "AB"); assertEquals(cap.getAccessMode(), 1); Capability cap4 = new Capability("bla" + ((HashStorageLayout.WIN) ? ":" : "_") + "2", 1, 60, System.currentTimeMillis() / 1000 - 3600, "", 0, false, SnapConfig.SNAP_CONFIG_SNAPS_DISABLED, 0, SECRET); assertFalse(cap4.isValid()); }