@Test
public void testGetPermissions() throws IOException, NoSuchAlgorithmException {

    assert tempFile.getPermissions() != null;
    createFile(tempFile, 0);
    FilePermissions permissions = tempFile.getPermissions();
    PermissionBits getPermMask = permissions.getMask();
    assert permissions != null;
    int getPermMaskInt = getPermMask.getIntValue();
    int bitShift = 0;
    int bitMask;
    boolean canGetPermission;
    for(PermissionAccess a : PermissionAccess.values()) {
        for(PermissionType p : PermissionType.values()) {
            bitMask = 1<<bitShift;
            canGetPermission = (getPermMaskInt & bitMask)!=0;
            assert getPermMask.getBitValue(a, p)==canGetPermission: "inconsistent bit and int value for ("+a+", "+p+")";
            if(canGetPermission) {
                assert permissions.getBitValue(a, p)==((permissions.getIntValue() & bitMask)!=0):
                        "inconsistent bit and int value for ("+a+", "+p+")";
            }
            bitShift++;
        }
    }
}