### Question:
GraphQueryResult implements Query.Result { @Override public Entity getEntity() { return queryResult.getEntityResponse().size() > 0 ? queryResult.getEntityResponse().get(0) : null; } GraphQueryResult(
			final QueryResult<Entity, Relationship> queryResult); @Override Entity getEntity(); @Override List<Entity> getEntities(); @Override Relationship getRelationship(); @Override List<Relationship> getRelationships();  }### Answer:
@Test public void testGetEntityWithEmptyList(){ CurrentOperationType currentOperation = CurrentOperationType.ENTITY; QueryResult<Entity, Relationship> queryResult = new QueryResultImpl(currentOperation); GraphQueryResult graphQueryResult = new GraphQueryResult(queryResult ); assertNull(graphQueryResult.getEntity()); }
@Test public void testGetEntityWithEntityList(){ CurrentOperationType currentOperation = CurrentOperationType.ENTITY; QueryResult<Entity, Relationship> queryResult = new QueryResultImpl(currentOperation); List<Entity> entityList = new ArrayList<Entity>(); GraphEntity builtEntity = getEntity(); entityList.add(builtEntity); queryResult.setEntityOpResponse(entityList ); GraphQueryResult graphQueryResult = new GraphQueryResult(queryResult ); assertNotNull(graphQueryResult.getEntity()); assertEquals(builtEntity, graphQueryResult.getEntity()); }