[ONOS-5787]YANG tools to generate updated Service interface

Change-Id: I5091fd115b0467928d34095a59d472da603df625
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
index 0ce482a..9ff2b15 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
@@ -45,6 +45,7 @@
 import org.onosproject.yang.compiler.datamodel.YangMust;
 import org.onosproject.yang.compiler.datamodel.YangMustHolder;
 import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
 import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
 import org.onosproject.yang.compiler.datamodel.YangResolutionInfo;
 import org.onosproject.yang.compiler.datamodel.YangRpc;
@@ -310,6 +311,25 @@
     }
 
     /**
+     * Checks if there is any rpc/notification defined in the module or
+     * sub-module.
+     *
+     * @param rootNode root node of the data model
+     * @return status of rpc/notification existence
+     */
+    public static boolean isRpcNotificationPresent(YangNode rootNode) {
+        YangNode childNode = rootNode.getChild();
+        while (childNode != null) {
+            if (childNode instanceof YangRpc ||
+                    childNode instanceof YangNotification) {
+                return true;
+            }
+            childNode = childNode.getNextSibling();
+        }
+        return false;
+    }
+
+    /**
      * Returns referred node in a given set.
      *
      * @param yangNodeSet YANG node set
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java
index 4657692..426806a 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java
@@ -18,7 +18,6 @@
 import org.onosproject.yang.compiler.datamodel.RpcNotificationContainer;
 import org.onosproject.yang.compiler.datamodel.YangAugment;
 import org.onosproject.yang.compiler.datamodel.YangCase;
-import org.onosproject.yang.compiler.datamodel.YangChoice;
 import org.onosproject.yang.compiler.datamodel.YangDataStructure;
 import org.onosproject.yang.compiler.datamodel.YangLeaf;
 import org.onosproject.yang.compiler.datamodel.YangLeafList;
@@ -115,7 +114,6 @@
 import static org.onosproject.yang.compiler.utils.UtilConstants.GOOGLE_MORE_OBJECT_IMPORT_CLASS;
 import static org.onosproject.yang.compiler.utils.UtilConstants.GOOGLE_MORE_OBJECT_IMPORT_PKG;
 import static org.onosproject.yang.compiler.utils.UtilConstants.INTERFACE;
-import static org.onosproject.yang.compiler.utils.UtilConstants.INVOCATION_TARGET_EXCEPTION;
 import static org.onosproject.yang.compiler.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_CLASS;
 import static org.onosproject.yang.compiler.utils.UtilConstants.JAVA_UTIL_PKG;
 import static org.onosproject.yang.compiler.utils.UtilConstants.KEYS;
@@ -128,7 +126,6 @@
 import static org.onosproject.yang.compiler.utils.UtilConstants.PRIVATE;
 import static org.onosproject.yang.compiler.utils.UtilConstants.PROTECTED;
 import static org.onosproject.yang.compiler.utils.UtilConstants.QUESTION_MARK;
-import static org.onosproject.yang.compiler.utils.UtilConstants.REFLECT_IMPORTS;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SERVICE;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SPACE;
@@ -576,18 +573,6 @@
         TempJavaBeanFragmentFiles tempFiles =
                 getBeanFiles((JavaCodeGeneratorInfo) parent);
         tempFiles.setAttrNode(curNode);
-        JavaFileInfoTranslator fileInfo = ((JavaCodeGeneratorInfo) parent)
-                .getJavaFileInfo();
-        if (curNode instanceof YangChoice && curNode.isOpTypeReq()) {
-            JavaQualifiedTypeInfoTranslator info = new
-                    JavaQualifiedTypeInfoTranslator();
-            info.setClassInfo(INVOCATION_TARGET_EXCEPTION);
-            info.setPkgInfo(REFLECT_IMPORTS);
-            info.setForInterface(false);
-            tempFiles.getJavaImportData().addImportInfo(
-                    info, getCapitalCase(fileInfo.getJavaName()),
-                    fileInfo.getPackage());
-        }
         JavaAttributeInfo attr = getCurNodeAsAttributeInTarget(
                 curNode, parent, isList, tempFiles);
         tempFiles.addJavaSnippetInfoToApplicableTempFiles(attr, config);
@@ -645,17 +630,6 @@
             }
             qualified = parentImportData.addImportInfo(typeInfo, className,
                                                        fileInfo.getPackage());
-            if (!qualified && !(curNode instanceof YangChoice) &&
-                    targetNode.isOpTypeReq()) {
-                String name = DEFAULT_CAPS + typeInfo.getClassInfo();
-                JavaQualifiedTypeInfoTranslator qInfo =
-                        new JavaQualifiedTypeInfoTranslator();
-                qInfo.setForInterface(false);
-                qInfo.setPkgInfo(typeInfo.getPkgInfo());
-                qInfo.setClassInfo(name);
-                parentImportData.addImportInfo(qInfo, className,
-                                               fileInfo.getPackage());
-            }
         }
         boolean collectionSet = false;
         if (curNode instanceof YangList) {
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java
index d55d5ce..ddc83f2 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java
@@ -51,7 +51,7 @@
 import java.util.Map;
 
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.getParentNodeInGenCode;
-import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.isRpcChildNodePresent;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.isRpcNotificationPresent;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
 import static org.onosproject.yang.compiler.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile;
@@ -501,7 +501,7 @@
         }
         updatePackageInfo(info, config, rootPkg);
 
-        if (isRpcChildNodePresent((YangNode) info)) {
+        if (isRpcNotificationPresent((YangNode) info)) {
             info.getJavaFileInfo().addGeneratedFileTypes(GENERATE_SERVICE_AND_MANAGER);
         }
         generateTempFiles(info, config);
@@ -544,16 +544,6 @@
     }
 
     /**
-     * Returns true if get/set method of root node are required.
-     *
-     * @param node root node
-     * @return true if get/set method of root node are required
-     */
-    public static boolean isGetSetOfRootNodeRequired(YangNode node) {
-        return isNodeCodeGenRequired(node, false);
-    }
-
-    /**
      * Returns true if either get/set method of root node are required or root
      * node contains any data node. This check is done depending on the
      * boolean parameter indicating whether check to be performed for root
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaModuleTranslator.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaModuleTranslator.java
index dbc6803..51fb388 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaModuleTranslator.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaModuleTranslator.java
@@ -28,6 +28,8 @@
 import java.io.IOException;
 import java.util.ArrayList;
 
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.isRpcChildNodePresent;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.isRpcNotificationPresent;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
@@ -133,7 +135,9 @@
         try {
             generateCodeOfRootNode(this, yangPlugin, modulePkg);
             //Add augmented rpc name
-            tempFileHandle.getServiceTempFiles().addAugmentedRpcMethod(this);
+            if (isRpcChildNodePresent(this)) {
+                tempFileHandle.getServiceTempFiles().addAugmentedRpcMethod(this);
+            }
         } catch (IOException e) {
             throw new TranslatorException(getErrorMsg(FAIL_AT_ENTRY, this,
                                                       e.getLocalizedMessage()));
@@ -173,8 +177,10 @@
                         .getCodeGenerateForSbi() == null ||
                         !getJavaFileInfo().getPluginConfig()
                                 .getCodeGenerateForSbi().equals(SBI)) {
-                    getTempJavaCodeFragmentFiles()
-                            .generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
+                    if (isRpcNotificationPresent(this)) {
+                        getTempJavaCodeFragmentFiles()
+                                .generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
+                    }
                 }
             }
 
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaSubModuleTranslator.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaSubModuleTranslator.java
index 5cee773..76e3ff7 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaSubModuleTranslator.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/javamodel/YangJavaSubModuleTranslator.java
@@ -29,6 +29,8 @@
 import java.io.IOException;
 import java.util.ArrayList;
 
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.isRpcChildNodePresent;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.isRpcNotificationPresent;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
@@ -145,8 +147,10 @@
         }
         try {
             generateCodeOfRootNode(this, yangPlugin, subModulePkg);
-            tempFileHandle.getServiceTempFiles().addAugmentedRpcMethod(
-                    this);
+            if (isRpcChildNodePresent(this)) {
+                tempFileHandle.getServiceTempFiles().addAugmentedRpcMethod(
+                        this);
+            }
         } catch (IOException e) {
             throw new TranslatorException(getErrorMsg(FAIL_AT_ENTRY, this,
                                                       e.getLocalizedMessage()));
@@ -183,8 +187,10 @@
                         .getCodeGenerateForSbi() == null ||
                         !getJavaFileInfo().getPluginConfig()
                                 .getCodeGenerateForSbi().equals(SBI)) {
-                    getTempJavaCodeFragmentFiles().generateJavaFile(
-                            GENERATE_SERVICE_AND_MANAGER, this);
+                    if (isRpcNotificationPresent(this)) {
+                        getTempJavaCodeFragmentFiles().generateJavaFile(
+                                GENERATE_SERVICE_AND_MANAGER, this);
+                    }
                 }
             }
 
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/ClassDefinitionGenerator.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/ClassDefinitionGenerator.java
index 3613548..896426a 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/ClassDefinitionGenerator.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/ClassDefinitionGenerator.java
@@ -240,16 +240,10 @@
      */
     private static String getImplClassDefinition(String yangName,
                                                  YangNode curNode) {
-        if (!(curNode instanceof YangCase)) {
-            String clsDef = getClassDefinitionForWhenExtended(
-                    curNode, yangName, DEFAULT_CLASS_MASK);
-            if (clsDef != null) {
-                return clsDef;
-            }
-        }
-        if (curNode instanceof RpcNotificationContainer) {
-            return getDefaultDefinitionWithImpl(
-                    CLASS, getSuffixedName(yangName, OP_PARAM), PUBLIC, yangName);
+        String clsDef = getClassDefinitionForWhenExtended(
+                curNode, yangName, DEFAULT_CLASS_MASK);
+        if (clsDef != null) {
+            return clsDef;
         }
         return getDefaultDefinitionWithImpl(CLASS, getDefaultName(yangName),
                                             PUBLIC, yangName);
@@ -433,16 +427,10 @@
                     def.append(SPACE).append(IMPLEMENTS).append(SPACE)
                             .append(yangName).append(PERIOD)
                             .append(yangName).append(BUILDER);
-//                    def.append(STATIC).append(SPACE).append(CLASS)
-//                            .append(SPACE).append(yangName).append(BUILDER)
-//                            .append(SPACE).append(EXTEND).append(SPACE);
-//                    def = new StringBuilder(getDefinitionString(def.toString(),
-//                                                                holder));
-//                    def.append(SPACE).append(IMPLEMENTS).append(SPACE)
-//                            .append(yangName).append(PERIOD)
-//                            .append(yangName).append(BUILDER);
                     break;
                 case DEFAULT_CLASS_MASK:
+
+                    // class defination
                     if (curNode instanceof RpcNotificationContainer) {
                         def.append(CLASS).append(SPACE).append(yangName)
                                 .append(OP_PARAM).append(SPACE).append(EXTEND)
@@ -452,9 +440,18 @@
                                 .append(yangName).append(SPACE).append(EXTEND)
                                 .append(SPACE);
                     }
-                    def = new StringBuilder(getDefinitionString(def.toString(),
-                                                                holder));
-                    def.append(SPACE).append(IMPLEMENTS).append(SPACE)
+
+                    // append with extendList
+                    if (curNode instanceof YangCase) {
+                        def = new StringBuilder(getDefinitionStringForCase(def.toString(),
+                                                                           holder));
+                    } else {
+                        def = new StringBuilder(getDefinitionString(def.toString(),
+                                                                    holder));
+                    }
+
+                    // append implements
+                    def.append(IMPLEMENTS).append(SPACE)
                             .append(yangName);
                     break;
                 default:
@@ -489,4 +486,24 @@
         def = builder.toString();
         return trimAtLast(def, COMMA);
     }
+
+    /**
+     * Returns updated class definition for case.
+     *
+     * @param def    current definition
+     * @param holder extend list holder
+     * @return updated class definition
+     */
+    private static String getDefinitionStringForCase(String def,
+                                                     JavaExtendsListHolder holder) {
+        StringBuilder builder = new StringBuilder(def);
+        for (JavaQualifiedTypeInfoTranslator info : holder.getExtendsList()) {
+            if (!info.getClassInfo().equals(MODEL_OBJECT)) {
+                continue;
+            }
+            builder.append(info.getClassInfo() + COMMA + SPACE);
+        }
+        def = builder.toString();
+        return trimAtLast(def, COMMA);
+    }
 }
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/JavaFileGenerator.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/JavaFileGenerator.java
index cfdba13..b9c609e 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/JavaFileGenerator.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/JavaFileGenerator.java
@@ -76,9 +76,7 @@
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedTempFileType.SETTER_FOR_CLASS_MASK;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK;
 import static org.onosproject.yang.compiler.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK;
-import static org.onosproject.yang.compiler.translator.tojava.TempJavaFragmentFiles.getCurNodeAsAttributeInTarget;
 import static org.onosproject.yang.compiler.translator.tojava.TempJavaFragmentFiles.getListOfAttributesForKey;
-import static org.onosproject.yang.compiler.translator.tojava.YangJavaModelUtils.isGetSetOfRootNodeRequired;
 import static org.onosproject.yang.compiler.translator.tojava.utils.IndentationType.FOUR_SPACE;
 import static org.onosproject.yang.compiler.translator.tojava.utils.JavaCodeSnippetGen.addStaticAttributeIntRange;
 import static org.onosproject.yang.compiler.translator.tojava.utils.JavaCodeSnippetGen.addStaticAttributeLongRange;
@@ -95,7 +93,6 @@
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getAddAugmentationString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getAugmentationString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getAugmentationsString;
-import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getAugmentsDataMethodForService;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getBitSetEnumClassFromString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getBitSetEnumClassToString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getCompareToForKeyClass;
@@ -109,7 +106,6 @@
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getFromStringMethodSignature;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getGetter;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getGetterForClass;
-import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getGetterString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getHashCodeMethod;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getHashCodeMethodClose;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getHashCodeMethodOpen;
@@ -117,7 +113,6 @@
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getRangeValidatorMethodForUnion;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getRemoveAugmentationString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getSetterForClass;
-import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getSetterString;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getToStringForEnumClass;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getToStringForType;
 import static org.onosproject.yang.compiler.translator.tojava.utils.MethodsGenerator.getToStringMethodClose;
@@ -1046,25 +1041,8 @@
                                    curNode, className);
 
         List<String> methods = new ArrayList<>();
-        JavaAttributeInfo rootAttribute =
-                getCurNodeAsAttributeInTarget(curNode, curNode, false,
-                                              tempFiles);
 
         try {
-
-            if (isGetSetOfRootNodeRequired(curNode)) {
-                //Getter methods.
-                methods.add(getGetterString(rootAttribute,
-                                            GENERATE_SERVICE_AND_MANAGER) +
-                                    NEW_LINE);
-                // Setter methods.
-                methods.add(getSetterString(rootAttribute, className,
-                                            GENERATE_SERVICE_AND_MANAGER) +
-                                    NEW_LINE);
-            }
-
-            methods.add(getAugmentsDataMethodForService(curNode));
-
             if (((JavaCodeGeneratorInfo) curNode).getTempJavaCodeFragmentFiles()
                     .getServiceTempFiles() != null) {
                 JavaCodeGeneratorInfo javaGenInfo =
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java
index e1cad16..6612ab6 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java
@@ -20,9 +20,9 @@
 import org.hamcrest.core.Is;
 import org.junit.Test;
 import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.translator.tojava.YangJavaModelUtils;
 import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 
 import java.io.IOException;
 
@@ -47,11 +47,9 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -68,7 +66,6 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -85,7 +82,6 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -102,11 +98,9 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -124,11 +118,9 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -145,7 +137,6 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -163,11 +154,9 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }
@@ -185,7 +174,6 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isGetSetOfRootNodeRequired(node)));
                 assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
             }
         }