### Question:
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal fromRootEntity(ID id) { Preconditions.argumentNotNull(id, "id"); pipeline.add(new GetEntityByID(id)); return this; } GraphQueryImpl(GraphVisitor repository); @Override Queries.GraphTraversal selectAdjacentEntitiesVia(
			Relationship.Name name); @Override Queries.GraphTraversal selectAdjacentEntitiesVia(
			Relationship.Name name, Direction direction); @Override Queries.GraphTraversal selectAdjacentRelationships(
			Relationship.Name name); @Override Queries.GraphTraversal selectAdjacentRelationships(
			Relationship.Name name, Direction direction); @Override Queries.GraphTraversal where(Predicate predicate); @Override Queries.GraphTraversal fromRootEntity(ID id); @Override Projection select();  }### Answer:
@Test public void testFromRootEntityWithNullId(){ GraphVisitor repository = new MockGraphVisitor(); GraphQueryImpl graphQueryImpl = new GraphQueryImpl(repository); try{ graphQueryImpl.fromRootEntity(null); Assert.fail("Should have thrown exception"); }catch(Exception e){ AssertJUnit.assertTrue(e instanceof IllegalArgumentException); AssertJUnit.assertEquals(e.getMessage(), "Parameter \"id\" cannot be null"); } }
@Test public void testFromRootEntityWithValidId(){ GraphVisitor repository = new MockGraphVisitor(); GraphQueryImpl graphQueryImpl = new GraphQueryImpl(repository); Entity.ID sourceEntityID = Entity.ID.valueOf("urn:entity:" + TartanImplTestConstants.ATTR_PARENT_ID.getName() + "." + TartanImplTestConstants.ATTR_PARENT_ID.getName() + "/" + UUID.randomUUID()); GraphTraversal fromRootEntity = graphQueryImpl.fromRootEntity(sourceEntityID); AssertJUnit.assertNotNull(fromRootEntity); }