### Question:
AffinityLock implements Closeable { public static AffinityLock acquireLock() { return acquireLock(true); } AffinityLock(int cpuId, boolean base, boolean reservable, LockInventory lockInventory); static void cpuLayout(@NotNull CpuLayout cpuLayout); @NotNull static CpuLayout cpuLayout(); static AffinityLock acquireLock(); static AffinityLock acquireCore(); static AffinityLock acquireLock(boolean bind); static AffinityLock acquireLock(int cpuId); static AffinityLock acquireLockLastMinus(int n); static AffinityLock acquireLock(String desc); static AffinityLock acquireCore(boolean bind); @NotNull static String dumpLocks(); boolean resetAffinity(); AffinityLock resetAffinity(boolean resetAffinity); void bind(); void bind(boolean wholeCore); AffinityLock acquireLock(AffinityStrategy... strategies); void release(); @Override void close(); int cpuId(); boolean isAllocated(); boolean isBound(); @Override String toString(); static final String AFFINITY_RESERVED; static final int PROCESSORS; static final BitSet BASE_AFFINITY; static final BitSet RESERVED_AFFINITY; }### Answer:
@Test public void testAffinityLockDescriptions() { if (!Utilities.ISLINUX) { return; } try (AffinityLock lock = AffinityLock.acquireLock("last")) { assertEquals(PROCESSORS - 1, Affinity.getCpu()); } try (AffinityLock lock = AffinityLock.acquireLock("last")) { assertEquals(PROCESSORS - 1, Affinity.getCpu()); } try (AffinityLock lock = AffinityLock.acquireLock("last-1")) { assertEquals(PROCESSORS - 2, Affinity.getCpu()); } try (AffinityLock lock = AffinityLock.acquireLock("1")) { assertEquals(1, Affinity.getCpu()); } try (AffinityLock lock = AffinityLock.acquireLock("any")) { assertTrue(lock.bound); } try (AffinityLock lock = AffinityLock.acquireLock("none")) { assertFalse(lock.bound); } try (AffinityLock lock = AffinityLock.acquireLock((String) null)) { assertFalse(lock.bound); } try (AffinityLock lock = AffinityLock.acquireLock("0")) { assertFalse(lock.bound); } }