Utils { public static EList<Type> getReferencedTypes(Type type) { BasicEList<Type> types = new BasicEList<Type>(); types.add(type); if (type instanceof Entity) { Entity entityType = (Entity) type; for (Property property : entityType.getProperties()) { types.addAll(getReferencedTypes(property)); } types.add(entityType.getSuperType()); } return types; }  static InformationModel toInformationModel(Model model); static InformationModel wrapFunctionBlock(FunctionblockModel fbModel); static EList<Entity> getReferencedEntities(FunctionBlock fb); static EList<Enum> getReferencedEnums(FunctionBlock fb); static EList<Type> getReferencedTypes(Type type); static EList<Type> getReferencedTypes(Property property); static EList<Type> getReferencedTypes(FunctionBlock fb);  }
@Test public void getReferencedTypesForFb() { assertEquals(1, Utils.getReferencedTypes(fbms.stream().filter(fb -> fb.getName().equals("SomeFb")).findAny().get().getFunctionblock()).size()); assertEquals(1, Utils.getReferencedTypes(fbms.stream().filter(fb -> fb.getName().equals("SuperFb")).findAny().get().getFunctionblock()).size()); assertEquals(0, Utils.getReferencedTypes(fbms.stream().filter(fb -> fb.getName().equals("Push_button")).findAny().get().getFunctionblock()).size()); assertEquals(1, Utils.getReferencedTypes(fbms.stream().filter(fb -> fb.getName().equals("SuperSuperFb")).findAny().get().getFunctionblock()).size()); }