### Question:
PrivateLogLogic extends AbstractLogLogic<PrivateLogValue> { @Override protected boolean invokeLogic(long keyId) throws Exception { Operation operation = getOperation(operationTypeRandom); OperationTimestampPair prevOperation = timestamps.get(keyId); PrivateLogValue prevValue = checkedGetValue(keyId); PrivateLogValue backupValue = null; if (prevOperation != null) { if (prevValue == null || !prevValue.contains(prevOperation.operationId)) { backupValue = checkedGetValue(~keyId); boolean txEnabled = manager.getGeneralConfiguration().getTransactionSize() > 0; boolean valuePruned = maxPrunedOperationIds.get(keyId) != null && maxPrunedOperationIds.get(keyId) >= prevOperation.operationId; if ((backupValue == null || !backupValue.contains(prevOperation.operationId)) && (!txEnabled || !valuePruned)) { log.debugf("Detected stale read, keyId=%s, previousValue=%s, complementValue=%s", keyId, prevValue, backupValue); waitForStaleRead(prevOperation.timestamp); return false; } else { if (!txEnabled || !valuePruned) { prevValue = null; } } } } if (operation == BasicOperations.GET) { throw new UnsupportedOperationException("Only PUT and REMOVE operations are allowed for this logic"); } else if (prevValue == null || operation == BasicOperations.PUT) { PrivateLogValue nextValue; if (prevValue != null) { nextValue = getNextValue(keyId, prevValue); } else { if (backupValue == null) { backupValue = checkedGetValue(~keyId); } if (backupValue == null) { nextValue = new PrivateLogValue(stressor.id, operationId); } else { nextValue = getNextValue(keyId, backupValue); } } if (nextValue == null) { return false; } checkedPutValue(keyId, nextValue); if (backupValue != null) { delayedRemoveValue(~keyId, backupValue); } } else if (operation == BasicOperations.REMOVE) { PrivateLogValue nextValue = getNextValue(keyId, prevValue); if (nextValue == null) { return false; } checkedPutValue(~keyId, nextValue); delayedRemoveValue(keyId, prevValue); } if (transactionSize > 0) { txModifications.add(new KeyOperationPair(keyId, operationId)); } else { long now = TimeService.currentTimeMillis(); timestamps.put(keyId, new OperationTimestampPair(operationId, now)); log.tracef("Operation %d on %08X finished at %d", operationId, keyId, now); } return true; } PrivateLogLogic(BackgroundOpsManager manager, Range range);   }### Answer:
@Test(expectedExceptions = UnsupportedOperationException.class) public void testGetFails() throws Exception { BasicOperations.Cache cache = new CacheTraitRepository.BasicOperationsCache<>(); PrivateLogLogic logic = createLogic(new GeneralConfiguration(), new BackgroundStressorLogicConfiguration(), new LogLogicConfiguration(), cache); doReturn(BasicOperations.GET).when(logic).getOperation(any(Random.class)); logic.invokeLogic(0); }