code: public static List<GraphEntity> getEntities(Graph g, String typeName)
              throws NullEntity {
          GraphEntity[] ge = g.getEntities();
          List<GraphEntity> result = new ArrayList<>();
          for (int k = 0; k < ge.length; k++) {
              if (ge[k].getType().equals(typeName)) {
                  result.add(ge[k]);
              }
          }
          return result;
      }
docs: It obtains the entities in the graph "g" whose type is the same as
  "typeName".
  
  @param g The graph considered
  @param typeName The type being searched
  @return The list of entities
  @throws NullEntity