DMNUtils { public static Type getRootType(BaseDMNTypeImpl dmnType) { if (dmnType.getFeelType() instanceof BuiltInType) { return dmnType.getFeelType(); } else if (dmnType.getBaseType() != null) { return getRootType((BaseDMNTypeImpl) dmnType.getBaseType()); } return dmnType.getFeelType(); } private  DMNUtils(); static Type getRootType(BaseDMNTypeImpl dmnType); static DMNType navigateDMNType(DMNType rootType, List<String> steps);  }
@Test public void getRootType() { SimpleTypeImpl simpleTypeAny = new SimpleTypeImpl(null, "tSimple", null, false, Collections.emptyList(), null, BuiltInType.UNKNOWN); assertEquals(BuiltInType.UNKNOWN, DMNUtils.getRootType(simpleTypeAny)); Type aliasFeelType = new AliasFEELType("alias", BuiltInType.UNKNOWN); CompositeTypeImpl aliasType = new CompositeTypeImpl(null, "tSimple", null, false, Collections.emptyMap(), simpleTypeAny, aliasFeelType); assertEquals(BuiltInType.UNKNOWN, DMNUtils.getRootType(aliasType)); Type notBuiltInType = new AliasFEELType("notBuiltIn", BuiltInType.UNKNOWN); SimpleTypeImpl notBuiltIn = new SimpleTypeImpl(null, "tSimple", null, false, Collections.emptyList(), null, notBuiltInType); assertEquals(notBuiltInType, DMNUtils.getRootType(notBuiltIn)); }