### Question:
ManagedState extends NodeState { @Override public void handleFind(NodeStateContext nodeStateContext) { Client client = nodeStateContext.getClient(); Class<?> nodeDataClass = nodeStateContext.getDataClass(); EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(nodeStateContext.getPersistenceDelegator().getKunderaMetadata(), nodeDataClass); Object entityId = nodeStateContext.getEntityId(); Object nodeData = null; EntityReader reader = client.getReader(); if (reader == null) { return; } EnhanceEntity ee = reader.findById(entityId, entityMetadata, client); if (ee != null && ee.getEntity() != null) { Object entity = ee.getEntity(); if ((entityMetadata.getRelationNames() == null || entityMetadata.getRelationNames().isEmpty()) && !entityMetadata.isRelationViaJoinTable()) { nodeData = entity; } else { Map<Object, Object> relationStack = new HashMap<Object, Object>(); relationStack.put(nodeDataClass.getCanonicalName()+"#"+PropertyAccessorHelper.getId(entity, entityMetadata), entity); nodeData = reader.recursivelyFindEntities(ee.getEntity(), ee.getRelations(), entityMetadata, nodeStateContext.getPersistenceDelegator(), false,relationStack); } } if (nodeData != null) { nodeStateContext.setData(nodeData); nodeStateContext.getPersistenceCache().getMainCache().processNodeMapping((Node) nodeStateContext); nodeStateContext.setDirty(false); Object original = ((Node) nodeStateContext).clone(); ((Node) nodeStateContext).setOriginalNode((Node) original); } }  @Override void initialize(NodeStateContext nodeStateContext); @Override void handlePersist(NodeStateContext nodeStateContext); @Override void handleRemove(NodeStateContext nodeStateContext); @Override void handleRefresh(NodeStateContext nodeStateContext); @Override void handleMerge(NodeStateContext nodeStateContext); @Override void handleFind(NodeStateContext nodeStateContext); @Override void handleClose(NodeStateContext nodeStateContext); @Override void handleClear(NodeStateContext nodeStateContext); @Override void handleFlush(NodeStateContext nodeStateContext); @Override void handleLock(NodeStateContext nodeStateContext); @Override void handleDetach(NodeStateContext nodeStateContext); @Override void handleCommit(NodeStateContext nodeStateContext); @Override void handleRollback(NodeStateContext nodeStateContext); @Override void handleGetReference(NodeStateContext nodeStateContext); @Override void handleContains(NodeStateContext nodeStateContext);  }### Answer:
@Test public void testHandleFind() { try { Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.REFRESH); state.handleFind(storeNode); Assert.fail("Exception should be thrown because client is not available"); } catch (Exception e) { Assert.assertNotNull(e); } }