### Question:
EntityUtils { public static <T extends Entity> Map<Long, T> entitiesToMap(Collection<T> entities) { Map<Long, T> result = new HashMap<>(); for (T entity : entities) { result.put(entity.getId(), entity); } return result; } private  EntityUtils(); static Map<Long, T> entitiesToMap(Collection<T> entities); static Long[] ids(Iterable<? extends Entity> entities); static String valueToString(Object value); static Map<String, Object> propertiesToMap(Entity Entity); static Map<String, Object> propertiesToMap(Entity Entity, ObjectInclusionPolicy<String> propertyInclusionPolicy); static int deleteNodeAndRelationships(Node toDelete); static String nodeToString(Node node); static String relationshipToString(Relationship relationship); static String propertiesToString(Entity Entity); static int getInt(Entity Entity, String key); static int getInt(Entity Entity, String key, int defaultValue); static long getLong(Entity Entity, String key); static long getLong(Entity Entity, String key, long defaultValue); static float getFloat(Entity Entity, String key); static float getFloat(Entity Entity, String key, float defaultValue);  }### Answer:
@Test public void shouldConvertEntitiesToMap() { try (Transaction tx = database.beginTx()) { Map<Long, Node> nodeMap = entitiesToMap(Iterables.asList(database.getAllNodes())); assertEquals(0, nodeMap.get(0L).getId()); assertEquals(1, nodeMap.get(1L).getId()); assertEquals(2, nodeMap.get(2L).getId()); assertEquals(3, nodeMap.size()); } }