[ONOS-5178] Defect fix :No get/set for root node in generated service

Change-Id: I9d90068e4cdd3d35a9ee71fd1f00c4a635b191b7
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java
index a9c35c1..1f08863 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java
@@ -49,7 +49,7 @@
  */
 public abstract class YangIdentity
         extends YangNode
-        implements YangCommonInfo, Parsable, Serializable {
+        implements YangCommonInfo, Parsable, Serializable, YangTranslatorOperatorNode {
 
     private static final long serialVersionUID = 806201691L;
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java
index 8736083..469a5d5 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java
@@ -46,8 +46,9 @@
 /**
  * Represents the information about the revision.
  */
-public class YangRevision extends DefaultLocationInfo
-        implements YangDesc, YangReference, Parsable, Serializable {
+public class YangRevision
+        extends DefaultLocationInfo
+        implements YangDesc, YangReference, Parsable, Serializable, Comparable<YangRevision> {
 
     private static final long serialVersionUID = 8062016052L;
 
@@ -146,7 +147,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
 
     }
@@ -157,8 +159,17 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
 
     }
+
+    @Override
+    public int compareTo(YangRevision obj) {
+        if (this == obj) {
+            return 0;
+        }
+        return getRevDate().compareTo(obj.getRevDate());
+    }
 }
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
index 5598561..02389a1 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
@@ -16,12 +16,9 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import java.util.Date;
-
 import org.onosproject.yangutils.datamodel.ResolvableType;
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangReferenceResolver;
-import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
@@ -39,7 +36,6 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getCurrentDateForRevision;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
@@ -117,14 +113,7 @@
         Parsable tmpNode = listener.getParsedDataStack().peek();
         if (!(tmpNode instanceof YangModule)) {
             throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, MODULE_DATA,
-                    ctx.identifier().getText(), EXIT));
-        }
-
-        if (((YangModule) tmpNode).getRevision() == null) {
-            Date currentDate = getCurrentDateForRevision();
-            YangRevision currentRevision = new YangRevision();
-            currentRevision.setRevDate(currentDate);
-            ((YangModule) tmpNode).setRevision(currentRevision);
+                                                                    ctx.identifier().getText(), EXIT));
         }
 
         YangModule module = (YangModule) tmpNode;
@@ -132,7 +121,7 @@
                 && module.getUnresolvedResolutionList(ResolvableType.YANG_COMPILER_ANNOTATION).size() != 0
                 && module.getChild() != null) {
             throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, MODULE_DATA,
-                    ctx.identifier().getText(), EXIT));
+                                                                    ctx.identifier().getText(), EXIT));
         }
 
         try {
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
index b429e6d..d2c7347 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
@@ -16,11 +16,8 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import java.util.Date;
-
 import org.onosproject.yangutils.datamodel.ResolvableType;
 import org.onosproject.yangutils.datamodel.YangReferenceResolver;
-import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.datamodel.YangSubModule;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
@@ -40,7 +37,6 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getCurrentDateForRevision;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
@@ -89,7 +85,7 @@
 
         // Check if stack is empty.
         checkStackIsEmpty(listener, INVALID_HOLDER, SUB_MODULE_DATA, ctx.identifier().getText(),
-                ENTRY);
+                          ENTRY);
 
         String identifier = getValidIdentifier(ctx.identifier().getText(), SUB_MODULE_DATA, ctx);
 
@@ -118,19 +114,12 @@
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, SUB_MODULE_DATA, ctx.identifier().getText(),
-                EXIT);
+                             EXIT);
 
         Parsable tmpNode = listener.getParsedDataStack().peek();
         if (!(tmpNode instanceof YangSubModule)) {
             throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, SUB_MODULE_DATA,
-                    ctx.identifier().getText(), EXIT));
-        }
-
-        if (((YangSubModule) tmpNode).getRevision() == null) {
-            Date currentDate = getCurrentDateForRevision();
-            YangRevision currentRevision = new YangRevision();
-            currentRevision.setRevDate(currentDate);
-            ((YangSubModule) tmpNode).setRevision(currentRevision);
+                                                                    ctx.identifier().getText(), EXIT));
         }
 
         YangSubModule subModule = (YangSubModule) tmpNode;
@@ -138,7 +127,7 @@
                 && subModule.getUnresolvedResolutionList(ResolvableType.YANG_COMPILER_ANNOTATION).size() != 0
                 && subModule.getChild() != null) {
             throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, MODULE_DATA,
-                    ctx.identifier().getText(), EXIT));
+                                                                    ctx.identifier().getText(), EXIT));
         }
 
         try {
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
index f580da9..df1dcad 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
@@ -16,16 +16,6 @@
 
 package org.onosproject.yangutils.parser.impl.parserutils;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.regex.Pattern;
-
 import org.antlr.v4.runtime.ParserRuleContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -46,6 +36,16 @@
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Pattern;
+
 import static org.onosproject.yangutils.datamodel.YangPathArgType.ABSOLUTE_PATH;
 import static org.onosproject.yangutils.datamodel.YangPathArgType.RELATIVE_PATH;
 import static org.onosproject.yangutils.datamodel.YangPathOperator.EQUALTO;
@@ -123,16 +123,16 @@
 
         if (identifierString.length() > IDENTIFIER_LENGTH) {
             parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " name " + identifierString + " is " +
-                    "greater than 64 characters.");
+                                                          getYangConstructType(yangConstruct) + " name " + identifierString + " is " +
+                                                          "greater than 64 characters.");
         } else if (!IDENTIFIER_PATTERN.matcher(identifierString).matches()) {
             parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " name " + identifierString + " is not " +
-                    "valid.");
+                                                          getYangConstructType(yangConstruct) + " name " + identifierString + " is not " +
+                                                          "valid.");
         } else if (identifierString.toLowerCase().startsWith(XML)) {
             parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " identifier " + identifierString +
-                    " must not start with (('X'|'x') ('M'|'m') ('L'|'l')).");
+                                                          getYangConstructType(yangConstruct) + " identifier " + identifierString +
+                                                          " must not start with (('X'|'x') ('M'|'m') ('L'|'l')).");
         } else {
             return identifierString;
         }
@@ -159,16 +159,16 @@
 
         if (identifierString.length() > IDENTIFIER_LENGTH) {
             parserException = new ParserException("YANG file error : " + " identifier " + identifierString + " in " +
-                    getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() + " is " +
-                    "greater than 64 characters.");
+                                                          getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() + " is " +
+                                                          "greater than 64 characters.");
         } else if (!IDENTIFIER_PATTERN.matcher(identifierString).matches()) {
             parserException = new ParserException("YANG file error : " + " identifier " + identifierString + " in " +
-                    getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() + " is not " +
-                    "valid.");
+                                                          getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() + " is not " +
+                                                          "valid.");
         } else if (identifierString.toLowerCase().startsWith(XML)) {
             parserException = new ParserException("YANG file error : " + " identifier " + identifierString + " in " +
-                    getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
-                    " must not start with (('X'|'x') ('M'|'m') ('L'|'l')).");
+                                                          getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
+                                                          " must not start with (('X'|'x') ('M'|'m') ('L'|'l')).");
         } else {
             return identifierString;
         }
@@ -235,8 +235,8 @@
         String value = removeQuotesAndHandleConcat(integerValue);
         if (!value.matches(NON_NEGATIVE_INTEGER_PATTERN)) {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " value " + value + " is not " +
-                    "valid.");
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -247,8 +247,8 @@
             valueInInteger = Integer.parseInt(value);
         } catch (NumberFormatException e) {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " value " + value + " is not " +
-                    "valid.");
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -270,8 +270,8 @@
         String value = removeQuotesAndHandleConcat(integerValue);
         if (!INTEGER_PATTERN.matcher(value).matches()) {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " value " + value + " is not " +
-                    "valid.");
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -282,8 +282,8 @@
             valueInInteger = Integer.parseInt(value);
         } catch (NumberFormatException e) {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " value " + value + " is not " +
-                    "valid.");
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -309,8 +309,8 @@
             return false;
         } else {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " value " + value + " is not " +
-                    "valid.");
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -361,8 +361,8 @@
             return nodeIdentifier;
         } else {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " name " + nodeIdentifierString +
-                    " is not valid.");
+                                                                          getYangConstructType(yangConstruct) + " name " + nodeIdentifierString +
+                                                                          " is not valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -395,8 +395,8 @@
             return nodeIdentifier;
         } else {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + yangLeafRef.getPath() +
-                    " is not valid.");
+                                                                          getYangConstructType(yangConstruct) + yangLeafRef.getPath() +
+                                                                          " is not valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -419,7 +419,7 @@
         if (completePathString.startsWith(SLASH)) {
             yangLeafRef.setPathType(ABSOLUTE_PATH);
             List<YangAtomicPath> yangAtomicPathListList = validateAbsolutePath(completePathString, yangConstruct, ctx,
-                    yangLeafRef);
+                                                                               yangLeafRef);
             validatePrefixAndYangNode(yangAtomicPathListList, yangLeafRef);
             yangLeafRef.setAtomicPath(yangAtomicPathListList);
         } else if (completePathString.startsWith(ANCESTOR_ACCESSOR)) {
@@ -427,8 +427,8 @@
             validateRelativePath(completePathString, yangConstruct, ctx, yangLeafRef);
         } else {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + yangLeafRef.getPath() +
-                    " does not follow valid path syntax");
+                                                                          getYangConstructType(yangConstruct) + yangLeafRef.getPath() +
+                                                                          " does not follow valid path syntax");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -522,7 +522,7 @@
             atomicPath.add(yangAtomicPathPath);
             if (nodeIdentifier.getPrefix() != null && nodeIdentifier.getPrefix() != prefixOfFile) {
                 ParserException parserException = new ParserException("YANG file error : A leaf reference, in unique," +
-                        " must refer to a leaf in the list");
+                                                                              " must refer to a leaf in the list");
                 parserException.setLine(ctx.getStart().getLine());
                 parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
                 throw parserException;
@@ -557,8 +557,8 @@
                 }
                 if (leaf == null) {
                     ParserException parserException = new ParserException("YANG file error : A leaf reference, in " +
-                            "unique," +
-                            " must refer to a leaf under the list");
+                                                                                  "unique," +
+                                                                                  " must refer to a leaf under the list");
                     parserException.setLine(ctx.getStart().getLine());
                     parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
                     throw parserException;
@@ -582,10 +582,10 @@
         while (nodesInReference.hasNext()) {
             YangAtomicPath nodeInUnique = nodesInReference.next();
             YangNode referredNode = getReferredNodeFromTheUniqueNodes(nodeInUnique.getNodeIdentifier(),
-                    potentialReferredNode);
+                                                                      potentialReferredNode);
             if (referredNode == null) {
                 ParserException parserException = new ParserException("YANG file error : The target node in unique " +
-                        "reference path is invalid");
+                                                                              "reference path is invalid");
                 parserException.setLine(ctx.getStart().getLine());
                 parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
                 throw parserException;
@@ -678,16 +678,16 @@
         }
         if (completePathString == null || completePathString.length() == 0) {
             ParserException parserException = new ParserException("YANG file error : "
-                    + getYangConstructType(yangConstruct) + yangLeafRef.getPath() +
-                    " does not follow valid path syntax");
+                                                                          + getYangConstructType(yangConstruct) + yangLeafRef.getPath() +
+                                                                          " does not follow valid path syntax");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
         }
         relativePath.setAncestorNodeCount(numberOfAncestors);
         List<YangAtomicPath> atomicPath = validateAbsolutePath(SLASH_FOR_STRING + completePathString,
-                yangConstruct,
-                ctx, yangLeafRef);
+                                                               yangConstruct,
+                                                               ctx, yangLeafRef);
         validatePrefixAndYangNode(atomicPath, yangLeafRef);
         relativePath.setAtomicPathList(atomicPath);
         yangLeafRef.setRelativePath(relativePath);
@@ -714,8 +714,8 @@
             String path = completePathString.replaceFirst(SLASH_FOR_STRING, EMPTY_STRING);
             if (path == null || path.length() == 0) {
                 ParserException parserException = new ParserException("YANG file error : "
-                        + getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
-                        " does not follow valid path syntax");
+                                                                              + getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
+                                                                              " does not follow valid path syntax");
                 parserException.setLine(ctx.getStart().getLine());
                 parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
                 throw parserException;
@@ -733,8 +733,8 @@
 
                 if (matchedPathPredicate == null || matchedPathPredicate.length() == 0) {
                     ParserException parserException = new ParserException("YANG file error : "
-                            + getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
-                            " does not follow valid path syntax");
+                                                                                  + getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
+                                                                                  " does not follow valid path syntax");
                     parserException.setLine(ctx.getStart().getLine());
                     parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
                     throw parserException;
@@ -763,7 +763,7 @@
                 }
 
                 List<YangPathPredicate> pathPredicateList = validatePathPredicate(pathPredicate, yangConstruct, ctx,
-                        yangPathPredicate, yangLeafRef);
+                                                                                  yangPathPredicate, yangLeafRef);
                 YangAtomicPath atomicPath = new YangAtomicPath();
                 yangNodeIdentifier = getValidNodeIdentifierForLeafref(nodeIdentifier, yangConstruct, ctx, yangLeafRef);
                 atomicPath.setNodeIdentifier(yangNodeIdentifier);
@@ -815,11 +815,11 @@
             String pathPredicateForNode = pathPredicateString.next();
             pathPredicateForNode = (pathPredicateForNode.substring(1)).trim();
             pathPredicateForNode = pathPredicateForNode.substring(0,
-                    pathPredicateForNode.indexOf(CHAR_OF_CLOSE_SQUARE_BRACKET));
+                                                                  pathPredicateForNode.indexOf(CHAR_OF_CLOSE_SQUARE_BRACKET));
             pathEqualityExpression.add(pathPredicateForNode);
         }
         List<YangPathPredicate> validatedPathPredicateList = validatePathEqualityExpression(pathEqualityExpression,
-                yangConstruct, ctx, yangPathPredicate, yangLeafRef);
+                                                                                            yangConstruct, ctx, yangPathPredicate, yangLeafRef);
         return validatedPathPredicateList;
     }
 
@@ -849,9 +849,9 @@
             YangNodeIdentifier yangNodeIdentifierForPredicate;
             YangRelativePath yangRelativePath;
             yangNodeIdentifierForPredicate = getValidNodeIdentifierForLeafref(pathEqualityExpressionArray[0].trim(),
-                    yangConstruct, ctx, yangLeafRef);
+                                                                              yangConstruct, ctx, yangLeafRef);
             yangRelativePath = validatePathKeyExpression(pathEqualityExpressionArray[1].trim(), yangConstruct, ctx,
-                    yangLeafRef);
+                                                         yangLeafRef);
             yangPathPredicate.setNodeIdentifier(yangNodeIdentifierForPredicate);
             yangPathPredicate.setPathOperator(EQUALTO);
             yangPathPredicate.setRightRelativePath(yangRelativePath);
@@ -885,7 +885,7 @@
             }
         }
         List<YangAtomicPath> atomicPathInRelativePath = validateRelativePathKeyExpression(rightAbsolutePath,
-                yangConstruct, ctx, yangLeafRef);
+                                                                                          yangConstruct, ctx, yangLeafRef);
         yangRelativePath.setAtomicPathList(atomicPathInRelativePath);
         yangRelativePath.setAncestorNodeCount(accessAncestor);
         return yangRelativePath;
@@ -915,8 +915,8 @@
 
         if (!(currentFunction[0].trim().equals(CURRENT)) || !(currentFunction[1].trim().equals(CLOSE_PARENTHESIS))) {
             ParserException parserException = new ParserException("YANG file error : "
-                    + getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
-                    " does not follow valid path syntax");
+                                                                          + getYangConstructType(yangConstruct) + " " + yangLeafRef.getPath() +
+                                                                          " does not follow valid path syntax");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -967,8 +967,8 @@
         // absolute-schema-nodeid = 1*("/" node-identifier)
         if (!tmpSchemaNodeId.startsWith(SLASH)) {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstructType) + " name " + argumentString +
-                    "is not valid");
+                                                                          getYangConstructType(yangConstructType) + " name " + argumentString +
+                                                                          "is not valid");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
@@ -999,7 +999,7 @@
         parserException.setLine(ctx.getStart().getLine());
         parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
         log.info(parserException.getMessage() + " at position " + parserException.getCharPositionInLine() +
-                " in line " + parserException.getLineNumber() + " of yang file " + fileName);
+                         " in line " + parserException.getLineNumber() + " of yang file " + fileName);
     }
 
     /**
@@ -1011,7 +1011,7 @@
      */
     public static Date getValidDateFromString(String dateInString, ParserRuleContext ctx) {
         String dateArgument = removeQuotesAndHandleConcat(dateInString);
-        if (dateArgument == null || !dateArgument.matches(DATE_PATTERN)) {
+        if (!dateArgument.matches(DATE_PATTERN)) {
             ParserException parserException = new ParserException("YANG file error: Input date is not correct");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
@@ -1023,8 +1023,7 @@
 
         try {
             //if not valid, it will throw ParseException
-            Date date = sdf.parse(dateArgument);
-            return date;
+            return sdf.parse(dateArgument);
         } catch (ParseException e) {
             ParserException parserException = new ParserException("YANG file error: Input date is not correct");
             parserException.setLine(ctx.getStart().getLine());
@@ -1049,8 +1048,8 @@
             return tmpData[0];
         } else {
             ParserException parserException = new ParserException("YANG file error : " +
-                    getYangConstructType(yangConstruct) + " name " + inputString +
-                    " is not valid.");
+                                                                          getYangConstructType(yangConstruct) + " name " + inputString +
+                                                                          " is not valid.");
             parserException.setLine(ctx.getStart().getLine());
             parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
             throw parserException;
diff --git a/plugin/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java b/plugin/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
index d89eee4..e661c32 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
@@ -254,7 +254,7 @@
             throws IOException {
         try {
             List<YangNode> interJarResolvedNodes = resolveInterJarDependencies(project, localRepository,
-                    remoteRepository, getDirectory(baseDir, outputDirectory));
+                                                                               remoteRepository, getDirectory(baseDir, outputDirectory));
             for (YangNode node : interJarResolvedNodes) {
                 YangFileInfo dependentFileInfo = new YangFileInfo();
                 node.setToTranslate(false);
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
index e20d788..1d566d8 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
@@ -395,7 +395,7 @@
         setJavaImportData(new JavaImportData());
         setJavaFileInfo(javaFileInfo);
         setAbsoluteDirPath(getAbsolutePackagePath(getJavaFileInfo().getBaseCodeGenPath(),
-                getJavaFileInfo().getPackageFilePath()));
+                                                  getJavaFileInfo().getPackageFilePath()));
 
         /*
          * Initialize getter when generation file type matches to interface
@@ -526,8 +526,9 @@
         YangNode parent = getParentNodeInGenCode(curNode);
         if (!(parent instanceof JavaCodeGenerator)) {
             throw new TranslatorException("missing parent node to contain current node info in generated file "
-                    + parent.getName() + " in " + parent.getLineNumber() + " at " + parent.getCharPosition()
-                    + " in " + parent.getFileName());
+                                                  + parent.getName() + " in " + parent.getLineNumber() + " at " +
+                                                  parent.getCharPosition()
+                                                  + " in " + parent.getFileName());
         }
 
         if (parent instanceof YangJavaGroupingTranslator) {
@@ -542,7 +543,7 @@
                 .getTempJavaCodeFragmentFiles().getBeanTempFiles();
 
         JavaAttributeInfo javaAttributeInfo = getCurNodeAsAttributeInTarget(curNode,
-                parent, isList, tempJavaBeanFragmentFiles);
+                                                                            parent, isList, tempJavaBeanFragmentFiles);
         tempJavaBeanFragmentFiles.addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo, pluginConfig);
     }
 
@@ -569,11 +570,12 @@
          * generated java files or qualified access
          */
         JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode,
-                getCapitalCase(curNodeName));
+                                                                                          getCapitalCase(curNodeName));
         if (!(targetNode instanceof TempJavaCodeFragmentFilesContainer)) {
             throw new TranslatorException("Parent node does not have file info "
-                    + targetNode.getName() + " in " + targetNode.getLineNumber() + " at " + targetNode.getCharPosition()
-                    + " in " + targetNode.getFileName());
+                                                  + targetNode.getName() + " in " + targetNode.getLineNumber() +
+                                                  " at " + targetNode.getCharPosition()
+                                                  + " in " + targetNode.getFileName());
         }
         JavaImportData parentImportData = tempJavaFragmentFiles.getJavaImportData();
         JavaFileInfoTranslator fileInfo = ((JavaFileInfoContainer) targetNode).getJavaFileInfo();
@@ -593,7 +595,7 @@
             }
 
             isQualified = parentImportData.addImportInfo(qualifiedTypeInfo,
-                    className, fileInfo.getPackage());
+                                                         className, fileInfo.getPackage());
         }
         boolean collectionSetFlag = false;
         if (curNode instanceof YangList) {
@@ -622,7 +624,7 @@
         }
         if (curNode instanceof YangList) {
             return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, isQualified, isListNode,
-                    ((YangList) curNode).getCompilerAnnotation());
+                                              ((YangList) curNode).getCompilerAnnotation());
         }
         return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, isQualified, isListNode);
     }
@@ -1050,7 +1052,7 @@
     private void addSubTreeFilteringForLeaf(JavaAttributeInfo attr)
             throws IOException {
         appendToFile(getSubtreeFilteringForLeafTempFileHandle(),
-                getSubtreeFilteringForLeaf(attr, attr.getAttributeType()) + NEW_LINE);
+                     getSubtreeFilteringForLeaf(attr, attr.getAttributeType()) + NEW_LINE);
     }
 
     /**
@@ -1062,7 +1064,7 @@
     private void addSubtreeFilteringForLeafList(JavaAttributeInfo attr)
             throws IOException {
         appendToFile(getGetSubtreeFilteringForListTempFileHandle(),
-                getSubtreeFilteringForLeafList(attr) + NEW_LINE);
+                     getSubtreeFilteringForLeafList(attr) + NEW_LINE);
     }
 
     /**
@@ -1074,7 +1076,7 @@
     private void addSubtreeFilteringForChildNode(JavaAttributeInfo attr)
             throws IOException {
         appendToFile(getGetSubtreeFilteringForChildNodeTempFileHandle(),
-                getSubtreeFilteringForNode(attr) + NEW_LINE);
+                     getSubtreeFilteringForNode(attr) + NEW_LINE);
     }
 
     /**
@@ -1100,7 +1102,7 @@
     private void addGetterForInterface(JavaAttributeInfo attr, YangPluginConfig pluginConfig)
             throws IOException {
         appendToFile(getGetterInterfaceTempFileHandle(),
-                getGetterString(attr, getGeneratedJavaFiles(), pluginConfig) + NEW_LINE);
+                     getGetterString(attr, getGeneratedJavaFiles(), pluginConfig) + NEW_LINE);
     }
 
     /**
@@ -1113,8 +1115,8 @@
     private void addSetterForInterface(JavaAttributeInfo attr, YangPluginConfig pluginConfig)
             throws IOException {
         appendToFile(getSetterInterfaceTempFileHandle(),
-                getSetterString(attr, getGeneratedJavaClassName(), getGeneratedJavaFiles(), pluginConfig)
-                        + NEW_LINE);
+                     getSetterString(attr, getGeneratedJavaClassName(), getGeneratedJavaFiles(), pluginConfig)
+                             + NEW_LINE);
     }
 
     /**
@@ -1127,7 +1129,7 @@
             throws IOException {
         if (isRooNode()) {
             appendToFile(getSetterImplTempFileHandle(), getJavaDoc(SETTER_METHOD, attr.getAttributeName(),
-                    attr.isListAttr(), pluginConfig, null) +
+                                                                   attr.isListAttr(), pluginConfig, null) +
                     getSetterForClass(attr, getGeneratedJavaClassName(), getGeneratedJavaFiles())
                     + NEW_LINE);
         } else {
@@ -1150,10 +1152,11 @@
                 || (getGeneratedJavaFiles() & GENERATE_SERVICE_AND_MANAGER) != 0) {
             if (!isRooNode()) {
                 appendToFile(getGetterImplTempFileHandle(), getOverRideString() + getGetterForClass(attr,
-                        getGeneratedJavaFiles()) + NEW_LINE);
+                                                                                                    getGeneratedJavaFiles()) +
+                        NEW_LINE);
             } else {
                 appendToFile(getGetterImplTempFileHandle(), getGetterForClass(attr,
-                        getGeneratedJavaFiles()) + NEW_LINE);
+                                                                              getGeneratedJavaFiles()) + NEW_LINE);
             }
         } else {
             String appDataStructure = null;
@@ -1161,8 +1164,8 @@
                 appDataStructure = attr.getCompilerAnnotation().getYangAppDataStructure().getDataStructure().name();
             }
             appendToFile(getGetterImplTempFileHandle(),
-                    getJavaDoc(GETTER_METHOD, getCapitalCase(attr.getAttributeName()), false, pluginConfig,
-                            appDataStructure) + getGetterForClass(attr, getGeneratedJavaFiles()) + NEW_LINE);
+                         getJavaDoc(GETTER_METHOD, getCapitalCase(attr.getAttributeName()), false, pluginConfig,
+                                    appDataStructure) + getGetterForClass(attr, getGeneratedJavaFiles()) + NEW_LINE);
         }
     }
 
@@ -1176,8 +1179,8 @@
     private void addAddToListInterface(JavaAttributeInfo attr, YangPluginConfig pluginConfig)
             throws IOException {
         appendToFile(getAddToListInterfaceTempFileHandle(),
-                getJavaDoc(ADD_TO_LIST, getCapitalCase(attr.getAttributeName()), false, pluginConfig, null)
-                        + getAddToListMethodInterface(attr, getGeneratedJavaClassName()) + NEW_LINE);
+                     getJavaDoc(ADD_TO_LIST, getCapitalCase(attr.getAttributeName()), false, pluginConfig, null)
+                             + getAddToListMethodInterface(attr, getGeneratedJavaClassName()) + NEW_LINE);
     }
 
     /**
@@ -1189,7 +1192,7 @@
     private void addAddToListImpl(JavaAttributeInfo attr)
             throws IOException {
         appendToFile(getAddToListImplTempFileHandle(),
-                getAddToListMethodImpl(attr, getGeneratedJavaClassName(), isRooNode()) + NEW_LINE);
+                     getAddToListMethodImpl(attr, getGeneratedJavaClassName(), isRooNode()) + NEW_LINE);
     }
 
     /**
@@ -1203,8 +1206,8 @@
     private void addLeafIdAttributes(JavaAttributeInfo attr, int value, YangPluginConfig yangPluginConfig)
             throws IOException {
         appendToFile(getLeafIdAttributeTempFileHandle(),
-                FOUR_SPACE_INDENTATION + generateEnumAttributeString(attr.getAttributeName(),
-                        value, yangPluginConfig));
+                     FOUR_SPACE_INDENTATION + generateEnumAttributeString(attr.getAttributeName(),
+                                                                          value, yangPluginConfig));
     }
 
     /**
@@ -1247,7 +1250,7 @@
             name = name + OP_PARAM;
             return NEW_LINE
                     + getDefaultConstructorString(name, modifier,
-                    pluginConfig);
+                                                  pluginConfig);
         }
         if (isSuffix) {
             return NEW_LINE +
@@ -1261,7 +1264,7 @@
         }
         return NEW_LINE
                 + getDefaultConstructorString(appended + name, modifier,
-                pluginConfig);
+                                              pluginConfig);
     }
 
     /**
@@ -1308,7 +1311,7 @@
                              JavaAttributeInfo fromStringAttributeInfo)
             throws IOException {
         appendToFile(getFromStringImplTempFileHandle(), getFromStringMethod(javaAttributeInfo,
-                fromStringAttributeInfo) + NEW_LINE);
+                                                                            fromStringAttributeInfo) + NEW_LINE);
     }
 
     /**
@@ -1337,7 +1340,7 @@
             }
         } else {
             throw new IOException(fileName + " is reused due to YANG naming. probably your previous build would have " +
-                    "failed");
+                                          "failed");
         }
         return file;
     }
@@ -1369,7 +1372,7 @@
             return readAppendFile(path + file.getName(), EMPTY_STRING);
         } else {
             throw new IOException("Unable to get data from the given "
-                    + file.getName() + " file for " + getGeneratedJavaClassName() + PERIOD);
+                                          + file.getName() + " file for " + getGeneratedJavaClassName() + PERIOD);
         }
     }
 
@@ -1402,11 +1405,12 @@
         }
         if (attr.isQualifiedName()) {
             return getJavaAttributeDefinition(attr.getImportInfo().getPkgInfo(),
-                    attr.getImportInfo().getClassInfo(),
-                    attributeName, attr.isListAttr(), attributeAccessType, attr.getCompilerAnnotation());
+                                              attr.getImportInfo().getClassInfo(),
+                                              attributeName, attr.isListAttr(), attributeAccessType,
+                                              attr.getCompilerAnnotation());
         } else {
             return getJavaAttributeDefinition(null, attr.getImportInfo().getClassInfo(), attributeName,
-                    attr.isListAttr(), attributeAccessType, attr.getCompilerAnnotation());
+                                              attr.isListAttr(), attributeAccessType, attr.getCompilerAnnotation());
         }
     }
 
@@ -1443,19 +1447,21 @@
         }
         if (!(curNode instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("missing java file information to get the package details "
-                    + "of attribute corresponding to child node " +
-                    curNode.getName() + " in " + curNode.getLineNumber() + " at " + curNode.getCharPosition()
-                    + " in " + curNode.getFileName());
+                                                  + "of attribute corresponding to child node " +
+                                                  curNode.getName() + " in " + curNode.getLineNumber() + " at " +
+                                                  curNode.getCharPosition()
+                                                  + " in " + curNode.getFileName());
         }
         caseImportInfo.setClassInfo(getCapitalCase(getCamelCase(parent.getName(),
-                pluginConfig.getConflictResolver())));
+                                                                pluginConfig.getConflictResolver())));
         caseImportInfo.setPkgInfo(((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage());
 
         JavaFileInfoTranslator fileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                 .getBeanTempFiles().getJavaImportData().addImportInfo(caseImportInfo,
-                getCapitalCase(fileInfo.getJavaName()), fileInfo.getPackage());
+                                                                      getCapitalCase(fileInfo.getJavaName()),
+                                                                      fileInfo.getPackage());
     }
 
     /**
@@ -1473,18 +1479,18 @@
             for (YangLeaf leaf : listOfLeaves) {
                 if (!(leaf instanceof JavaLeafInfoContainer)) {
                     throw new TranslatorException("Leaf does not have java information " +
-                            leaf.getName() + " in " + leaf.getLineNumber() + " at " +
-                            leaf.getCharPosition()
-                            + " in " + leaf.getFileName());
+                                                          leaf.getName() + " in " + leaf.getLineNumber() + " at " +
+                                                          leaf.getCharPosition()
+                                                          + " in " + leaf.getFileName());
                 }
                 if (curNode instanceof YangModule || curNode instanceof YangSubModule) {
                     TempJavaBeanFragmentFiles tempJavaBeanFragmentFiles = ((JavaCodeGeneratorInfo) curNode)
                             .getTempJavaCodeFragmentFiles().getBeanTempFiles();
                     addJavaSnippetInfoToApplicableTempFiles(getJavaAttributeOfLeaf(tempJavaBeanFragmentFiles, leaf,
-                            yangPluginConfig), yangPluginConfig);
+                                                                                   yangPluginConfig), yangPluginConfig);
                 } else {
                     addJavaSnippetInfoToApplicableTempFiles(getJavaAttributeOfLeaf(this, leaf, yangPluginConfig),
-                            yangPluginConfig);
+                                                            yangPluginConfig);
                 }
             }
         }
@@ -1505,17 +1511,20 @@
             for (YangLeafList leafList : listOfLeafList) {
                 if (!(leafList instanceof JavaLeafInfoContainer)) {
                     throw new TranslatorException("Leaf-list does not have java information " +
-                            curNode.getName() + " in " + curNode.getLineNumber() + " at " + curNode.getCharPosition()
-                            + " in " + curNode.getFileName());
+                                                          curNode.getName() + " in " + curNode.getLineNumber() +
+                                                          " at " + curNode.getCharPosition()
+                                                          + " in " + curNode.getFileName());
                 }
                 if (curNode instanceof YangModule || curNode instanceof YangSubModule) {
                     TempJavaBeanFragmentFiles tempJavaBeanFragmentFiles = ((JavaCodeGeneratorInfo) curNode)
                             .getTempJavaCodeFragmentFiles().getBeanTempFiles();
                     addJavaSnippetInfoToApplicableTempFiles(getJavaAttributeOfLeafList(tempJavaBeanFragmentFiles,
-                            leafList, yangPluginConfig), yangPluginConfig);
+                                                                                       leafList, yangPluginConfig),
+                                                            yangPluginConfig);
                 } else {
                     addJavaSnippetInfoToApplicableTempFiles(getJavaAttributeOfLeafList(this,
-                            leafList, yangPluginConfig), yangPluginConfig);
+                                                                                       leafList, yangPluginConfig),
+                                                            yangPluginConfig);
                 }
             }
         }
@@ -1533,8 +1542,9 @@
             throws IOException {
         if (!(curNode instanceof YangLeavesHolder)) {
             throw new TranslatorException("Data model node does not have any leaves " +
-                    curNode.getName() + " in " + curNode.getLineNumber() + " at " + curNode.getCharPosition()
-                    + " in " + curNode.getFileName());
+                                                  curNode.getName() + " in " + curNode.getLineNumber() + " at " +
+                                                  curNode.getCharPosition()
+                                                  + " in " + curNode.getFileName());
         }
         YangLeavesHolder leavesHolder = (YangLeavesHolder) curNode;
         addLeavesInfoToTempFiles(leavesHolder.getListOfLeaf(), yangPluginConfig, curNode);
@@ -1606,15 +1616,18 @@
 
             if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) {
                 JavaQualifiedTypeInfoTranslator qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo,
-                        pluginConfig.getConflictResolver());
+                                                                                                         pluginConfig
+                                                                                                                 .getConflictResolver());
             /*
              * Create a new java attribute info with qualified information of
              * wrapper classes.
              */
                 JavaAttributeInfo fromStringAttributeInfo = getAttributeInfoForTheData(qualifiedInfoOfFromString,
-                        newAttrInfo.getAttributeName(),
-                        newAttrInfo.getAttributeType(),
-                        getIsQualifiedAccessOrAddToImportList(qualifiedInfoOfFromString), false);
+                                                                                       newAttrInfo.getAttributeName(),
+                                                                                       newAttrInfo.getAttributeType(),
+                                                                                       getIsQualifiedAccessOrAddToImportList(
+                                                                                               qualifiedInfoOfFromString),
+                                                                                       false);
 
                 addFromStringMethod(newAttrInfo, fromStringAttributeInfo);
             }
@@ -1685,7 +1698,7 @@
                             getJavaFileHandle(getJavaClassName(BUILDER_INTERFACE_FILE_NAME_SUFFIX)));
                     setBuilderInterfaceJavaFileHandle(
                             generateBuilderInterfaceFile(getBuilderInterfaceJavaFileHandle(), curNode,
-                                    isAttributePresent()));
+                                                         isAttributePresent()));
 
                     //Append builder interface file to interface file and close it.
                     mergeJavaFiles(getBuilderInterfaceJavaFileHandle(), getInterfaceJavaFileHandle());
@@ -1728,7 +1741,7 @@
                 setBuilderClassJavaFileHandle(getJavaFileHandle(getJavaClassName(BUILDER_CLASS_FILE_NAME_SUFFIX)));
                 setBuilderClassJavaFileHandle(
                         generateBuilderClassFile(getBuilderClassJavaFileHandle(), curNode,
-                                isAttributePresent()));
+                                                 isAttributePresent()));
 
                 //Append impl class to builder class and close it.
                 mergeJavaFiles(getBuilderClassJavaFileHandle(), getImplClassJavaFileHandle());
@@ -1880,8 +1893,8 @@
     boolean getIsQualifiedAccessOrAddToImportList(
             JavaQualifiedTypeInfo importInfo) {
         return getJavaImportData().addImportInfo((JavaQualifiedTypeInfoTranslator) importInfo,
-                getGeneratedJavaClassName(),
-                getJavaFileInfo().getPackage());
+                                                 getGeneratedJavaClassName(),
+                                                 getJavaFileInfo().getPackage());
     }
 
     /**
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/YangJavaModelUtils.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/YangJavaModelUtils.java
index 08a6d9b..7891b08 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/YangJavaModelUtils.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/YangJavaModelUtils.java
@@ -26,10 +26,8 @@
 import org.onosproject.yangutils.datamodel.YangCase;
 import org.onosproject.yangutils.datamodel.YangChoice;
 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
-import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
-import org.onosproject.yangutils.datamodel.YangSubModule;
 import org.onosproject.yangutils.datamodel.YangTranslatorOperatorNode;
 import org.onosproject.yangutils.datamodel.YangTypeHolder;
 import org.onosproject.yangutils.datamodel.utils.DataModelUtils;
@@ -77,9 +75,9 @@
         } else {
             javaCodeGeneratorInfo.getJavaFileInfo()
                     .setJavaName(getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(),
-                            yangPluginConfig.getConflictResolver()));
+                                              yangPluginConfig.getConflictResolver()));
             javaCodeGeneratorInfo.getJavaFileInfo().setJavaAttributeName(javaCodeGeneratorInfo
-                    .getJavaFileInfo().getJavaName());
+                                                                                 .getJavaFileInfo().getJavaName());
             javaCodeGeneratorInfo.getJavaFileInfo().setPackage(getCurNodePackage((YangNode) javaCodeGeneratorInfo));
         }
         javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath(
@@ -102,7 +100,7 @@
             throws IOException {
         javaCodeGeneratorInfo.getJavaFileInfo()
                 .setJavaName(getAugmentClassName((YangJavaAugmentTranslator) javaCodeGeneratorInfo,
-                        yangPluginConfig));
+                                                 yangPluginConfig));
         javaCodeGeneratorInfo.getJavaFileInfo().setPackage(
                 getAugmentsNodePackage((YangNode) javaCodeGeneratorInfo, yangPluginConfig));
         javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath(
@@ -141,10 +139,11 @@
      * @throws IOException IO operations fails
      */
     private static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin,
-                                          String pkg) throws IOException {
+                                          String pkg)
+            throws IOException {
         javaCodeGeneratorInfo.getJavaFileInfo()
                 .setJavaName(getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(),
-                        yangPlugin.getConflictResolver()));
+                                          yangPlugin.getConflictResolver()));
         javaCodeGeneratorInfo.getJavaFileInfo().setPackage(pkg);
         javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath(
                 getPackageDirPathFromJavaJPackage(javaCodeGeneratorInfo.getJavaFileInfo().getPackage()));
@@ -174,12 +173,8 @@
                                                 YangPluginConfig yangPluginConfig)
             throws IOException {
 
-        if (javaCodeGeneratorInfo instanceof YangModule
-                || javaCodeGeneratorInfo instanceof YangSubModule) {
-            javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles().setRooNode(true);
-        }
-
         if (javaCodeGeneratorInfo instanceof RpcNotificationContainer) {
+            javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles().setRooNode(true);
             /*
              * Module / sub module node code generation.
              */
@@ -228,9 +223,9 @@
             /*Do nothing, only the interface needs to be generated*/
         } else {
             throw new TranslatorException("Unsupported Node Translation "
-                    + javaCodeGeneratorInfo.getLineNumber() + " at " +
-                    javaCodeGeneratorInfo.getCharPosition()
-                    + " in " + javaCodeGeneratorInfo.getFileName());
+                                                  + javaCodeGeneratorInfo.getLineNumber() + " at " +
+                                                  javaCodeGeneratorInfo.getCharPosition()
+                                                  + " in " + javaCodeGeneratorInfo.getFileName());
         }
     }
 
@@ -246,9 +241,9 @@
             throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             throw new TranslatorException("translation is not supported for the node "
-                    + javaCodeGeneratorInfo.getLineNumber() + " at " +
-                    javaCodeGeneratorInfo.getCharPosition()
-                    + " in " + javaCodeGeneratorInfo.getFileName());
+                                                  + javaCodeGeneratorInfo.getLineNumber() + " at " +
+                                                  javaCodeGeneratorInfo.getCharPosition()
+                                                  + " in " + javaCodeGeneratorInfo.getFileName());
         }
         createTempFragmentFile(javaCodeGeneratorInfo);
         updateTempFragmentFiles(javaCodeGeneratorInfo, yangPluginConfig);
@@ -295,9 +290,9 @@
             throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             throw new TranslatorException("Invalid node for translation " +
-                    javaCodeGeneratorInfo.getLineNumber() + " at " +
-                    javaCodeGeneratorInfo.getCharPosition()
-                    + " in " + javaCodeGeneratorInfo.getFileName());
+                                                  javaCodeGeneratorInfo.getLineNumber() + " at " +
+                                                  javaCodeGeneratorInfo.getCharPosition()
+                                                  + " in " + javaCodeGeneratorInfo.getFileName());
         }
 
         /*
@@ -323,9 +318,9 @@
             throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             throw new TranslatorException("invalid node for translation " +
-                    javaCodeGeneratorInfo.getLineNumber() + " at " +
-                    javaCodeGeneratorInfo.getCharPosition()
-                    + " in " + javaCodeGeneratorInfo.getFileName());
+                                                  javaCodeGeneratorInfo.getLineNumber() + " at " +
+                                                  javaCodeGeneratorInfo.getCharPosition()
+                                                  + " in " + javaCodeGeneratorInfo.getFileName());
         }
 
         generateCodeOfNode(javaCodeGeneratorInfo, yangPlugin);
@@ -336,7 +331,7 @@
             JavaQualifiedTypeInfoTranslator parentsInfo = getQualifierInfoForCasesParent(parent, yangPlugin);
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles().getJavaExtendsListHolder()
                     .addToExtendsList(parentsInfo, (YangNode) javaCodeGeneratorInfo,
-                            tempJavaCodeFragmentFiles.getBeanTempFiles());
+                                      tempJavaCodeFragmentFiles.getBeanTempFiles());
 
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles()
                     .addParentInfoInCurNodeTempFile((YangNode) javaCodeGeneratorInfo, yangPlugin);
@@ -388,9 +383,9 @@
             throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             throw new TranslatorException("invalid node for translation "
-                    + javaCodeGeneratorInfo.getLineNumber() + " at " +
-                    javaCodeGeneratorInfo.getCharPosition()
-                    + " in " + javaCodeGeneratorInfo.getFileName());
+                                                  + javaCodeGeneratorInfo.getLineNumber() + " at " +
+                                                  javaCodeGeneratorInfo.getCharPosition()
+                                                  + " in " + javaCodeGeneratorInfo.getFileName());
         }
         updatePackageInfo(javaCodeGeneratorInfo, yangPluginConfig);
         generateTempFiles(javaCodeGeneratorInfo, yangPluginConfig);
@@ -409,9 +404,9 @@
             throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             throw new TranslatorException("invalid node for translation " + javaCodeGeneratorInfo.getLineNumber()
-                    + " at " +
-                    javaCodeGeneratorInfo.getCharPosition()
-                    + " in " + javaCodeGeneratorInfo.getFileName());
+                                                  + " at " +
+                                                  javaCodeGeneratorInfo.getCharPosition()
+                                                  + " in " + javaCodeGeneratorInfo.getFileName());
         }
         updatePackageInfo(javaCodeGeneratorInfo, yangPluginConfig, rootPkg);
 
@@ -434,19 +429,19 @@
         if (!(curNode instanceof JavaFileInfoContainer)
                 || curNode.getParent() == null) {
             throw new TranslatorException("missing parent node to get current node's package " +
-                    curNode.getName() + " in " +
-                    curNode.getLineNumber() + " at " +
-                    curNode.getCharPosition()
-                    + " in " + curNode.getFileName());
+                                                  curNode.getName() + " in " +
+                                                  curNode.getLineNumber() + " at " +
+                                                  curNode.getCharPosition()
+                                                  + " in " + curNode.getFileName());
         }
 
         YangNode parentNode = DataModelUtils.getParentNodeInGenCode(curNode);
         if (!(parentNode instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("missing parent java node to get current node's package " +
-                    curNode.getName() + " in " +
-                    curNode.getLineNumber() + " at " +
-                    curNode.getCharPosition()
-                    + " in " + curNode.getFileName());
+                                                  curNode.getName() + " in " +
+                                                  curNode.getLineNumber() + " at " +
+                                                  curNode.getCharPosition()
+                                                  + " in " + curNode.getFileName());
         }
         JavaFileInfoTranslator parentJavaFileHandle = ((JavaFileInfoContainer) parentNode).getJavaFileInfo();
         pkg = parentJavaFileHandle.getPackage() + PERIOD + parentJavaFileHandle.getJavaName();
@@ -460,49 +455,57 @@
      * @return true if root node contains any data node
      */
     public static boolean isRootNodesCodeGenRequired(YangNode node) {
+        YangLeavesHolder holder = (YangLeavesHolder) node;
 
-        List<YangNode> childNodes = new ArrayList<>();
-        YangNode tempNode = node.getChild();
-        while (tempNode != null) {
-            childNodes.add(tempNode);
-            tempNode = tempNode.getNextSibling();
-        }
-
-        if (childNodes.size() == 0) {
-            YangLeavesHolder leavesHolder = (YangLeavesHolder) node;
-            return !leavesHolder.getListOfLeaf().isEmpty() || !leavesHolder.getListOfLeafList().isEmpty();
-        } else if (childNodes.size() == 1) {
-            return !(childNodes.get(0) instanceof YangTranslatorOperatorNode);
-        }
-        List<Boolean> booleanData = new ArrayList<>();
-        for (YangNode child : childNodes) {
-            if (child instanceof YangTranslatorOperatorNode) {
-                booleanData.add(false);
+        if (holder.getListOfLeaf().isEmpty()) {
+            if (holder.getListOfLeafList().isEmpty()) {
+                YangNode tempNode = node.getChild();
+                if (tempNode == null) {
+                    return false;
+                }
+                while (tempNode != null) {
+                    if (!(tempNode instanceof YangTranslatorOperatorNode)) {
+                        return true;
+                    }
+                    tempNode = tempNode.getNextSibling();
+                }
+                return false;
             } else {
-                booleanData.add(true);
+                return true;
             }
+        } else {
+            return true;
         }
-        return booleanData.contains(true);
     }
 
     /**
-     * Returns true if only augment nodes present in module.
+     * Returns true if get/set method of root node are required.
      *
      * @param curNode root node
-     * @return true if only augment nodes present in module
+     * @return true if get/set method of root node are required
      */
-    public static boolean isOnlyAugmentNodeInRoot(YangNode curNode) {
-        List<Boolean> booleanData = new ArrayList<>();
-        curNode = curNode.getChild();
-        while (curNode != null) {
-            if (curNode instanceof YangAugment) {
-                booleanData.add(true);
+    public static boolean isGetSetOfRootNodeRequired(YangNode curNode) {
+        YangLeavesHolder holder = (YangLeavesHolder) curNode;
+
+        if (holder.getListOfLeaf().isEmpty()) {
+            if (holder.getListOfLeafList().isEmpty()) {
+                curNode = curNode.getChild();
+                if (curNode == null) {
+                    return false;
+                }
+                while (curNode != null) {
+                    if (!(curNode instanceof YangAugment)) {
+                        return true;
+                    }
+                    curNode = curNode.getNextSibling();
+                }
+                return false;
             } else {
-                booleanData.add(false);
+                return true;
             }
-            curNode = curNode.getNextSibling();
+        } else {
+            return true;
         }
-        return !booleanData.contains(false);
     }
 
     /**
@@ -528,12 +531,12 @@
         if (node instanceof YangJavaModuleTranslator) {
             YangJavaModuleTranslator module = (YangJavaModuleTranslator) node;
             pkg.append(getRootPackage(module.getVersion(), module.getNameSpace(), module
-                    .getRevision().getRevDate(), yangPluginConfig.getConflictResolver()));
+                    .getRevision(), yangPluginConfig.getConflictResolver()));
         } else if (node instanceof YangJavaSubModuleTranslator) {
             YangJavaSubModuleTranslator subModule = (YangJavaSubModuleTranslator) node;
             pkg.append(getRootPackage(subModule.getVersion(),
-                    subModule.getNameSpaceFromModule(subModule.getBelongsTo()),
-                    subModule.getRevision().getRevDate(), yangPluginConfig.getConflictResolver()));
+                                      subModule.getNameSpaceFromModule(),
+                                      subModule.getRevision(), yangPluginConfig.getConflictResolver()));
         }
         String concat = "";
         for (int i = 1; i <= clsInfo.size(); i++) {
@@ -551,7 +554,7 @@
      * @param yangPluginConfig plugin configurations
      * @return augment class name
      */
-    static String getAugmentClassName(YangAugment augment, YangPluginConfig yangPluginConfig) {
+    private static String getAugmentClassName(YangAugment augment, YangPluginConfig yangPluginConfig) {
         YangNodeIdentifier yangNodeIdentifier = augment.getTargetNode().get(augment.getTargetNode().size() - 1)
                 .getNodeIdentifier();
         String name = getCapitalCase(getCamelCase(yangNodeIdentifier.getName(), yangPluginConfig
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/AttributesJavaDataType.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/AttributesJavaDataType.java
index 85c190b..d9517a8 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/AttributesJavaDataType.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/AttributesJavaDataType.java
@@ -112,10 +112,10 @@
                 return getJavaDataType(getReferredTypeFromLeafref(yangType));
             default:
                 throw new TranslatorException("given data type is not supported. " +
-                        yangType.getDataTypeName() + " in " +
-                        yangType.getLineNumber() + " at " +
-                        yangType.getCharPosition()
-                        + " in " + yangType.getFileName());
+                                                      yangType.getDataTypeName() + " in " +
+                                                      yangType.getLineNumber() + " at " +
+                                                      yangType.getCharPosition()
+                                                      + " in " + yangType.getFileName());
         }
     }
 
@@ -159,7 +159,7 @@
                 case ENUMERATION:
                     return getCapitalCase(
                             getCamelCase(((YangJavaEnumerationTranslator) yangType.getDataTypeExtendedInfo()).getName(),
-                                    pluginConfig));
+                                         pluginConfig));
                 case BITS:
                     return BIT_SET;
                 case BINARY:
@@ -184,10 +184,10 @@
                             getCamelCase(yangType.getDataTypeName(), pluginConfig));
                 default:
                     throw new TranslatorException("given data type is not supported ." +
-                            yangType.getDataTypeName() + " in " +
-                            yangType.getLineNumber() + " at " +
-                            yangType.getCharPosition()
-                            + " in " + yangType.getFileName());
+                                                          yangType.getDataTypeName() + " in " +
+                                                          yangType.getLineNumber() + " at " +
+                                                          yangType.getCharPosition()
+                                                          + " in " + yangType.getFileName());
             }
         } else {
             switch (type) {
@@ -198,7 +198,7 @@
                 case ENUMERATION:
                     return getCapitalCase(
                             getCamelCase(((YangJavaEnumerationTranslator) yangType.getDataTypeExtendedInfo()).getName(),
-                                    pluginConfig));
+                                         pluginConfig));
                 case BITS:
                     return BIT_SET;
                 case DECIMAL64:
@@ -273,10 +273,10 @@
                     return getTypeDefsPackage(yangType, conflictResolver);
                 default:
                     throw new TranslatorException("given data type is not supported. " +
-                            yangType.getDataTypeName() + " in " +
-                            yangType.getLineNumber() + " at " +
-                            yangType.getCharPosition()
-                            + " in " + yangType.getFileName());
+                                                          yangType.getDataTypeName() + " in " +
+                                                          yangType.getLineNumber() + " at " +
+                                                          yangType.getCharPosition()
+                                                          + " in " + yangType.getFileName());
             }
         } else {
             switch (type) {
@@ -318,18 +318,18 @@
         Object var = type.getDataTypeExtendedInfo();
         if (!(var instanceof YangDerivedInfo)) {
             throw new TranslatorException("type should have been derived. " +
-                    type.getDataTypeName() + " in " +
-                    type.getLineNumber() + " at " +
-                    type.getCharPosition()
-                    + " in " + type.getFileName());
+                                                  type.getDataTypeName() + " in " +
+                                                  type.getLineNumber() + " at " +
+                                                  type.getCharPosition()
+                                                  + " in " + type.getFileName());
         }
 
         if (!(((YangDerivedInfo<?>) var).getReferredTypeDef() != null)) {
             throw new TranslatorException("derived info is not an instance of typedef. " +
-                    type.getDataTypeName() + " in " +
-                    type.getLineNumber() + " at " +
-                    type.getCharPosition()
-                    + " in " + type.getFileName());
+                                                  type.getDataTypeName() + " in " +
+                                                  type.getLineNumber() + " at " +
+                                                  type.getCharPosition()
+                                                  + " in " + type.getFileName());
         }
 
         YangJavaTypeDefTranslator typedef = (YangJavaTypeDefTranslator) ((YangDerivedInfo<?>) var).getReferredTypeDef();
@@ -350,10 +350,10 @@
 
         if (!(type.getDataTypeExtendedInfo() instanceof YangUnion)) {
             throw new TranslatorException("type should have been union. " +
-                    type.getDataTypeName() + " in " +
-                    type.getLineNumber() + " at " +
-                    type.getCharPosition()
-                    + " in " + type.getFileName());
+                                                  type.getDataTypeName() + " in " +
+                                                  type.getLineNumber() + " at " +
+                                                  type.getCharPosition()
+                                                  + " in " + type.getFileName());
         }
 
         YangJavaUnionTranslator union = (YangJavaUnionTranslator) type.getDataTypeExtendedInfo();
@@ -374,10 +374,10 @@
 
         if (!(type.getDataTypeExtendedInfo() instanceof YangEnumeration)) {
             throw new TranslatorException("type should have been enumeration. " +
-                    type.getDataTypeName() + " in " +
-                    type.getLineNumber() + " at " +
-                    type.getCharPosition()
-                    + " in " + type.getFileName());
+                                                  type.getDataTypeName() + " in " +
+                                                  type.getLineNumber() + " at " +
+                                                  type.getCharPosition()
+                                                  + " in " + type.getFileName());
         }
         YangJavaEnumerationTranslator enumeration = (YangJavaEnumerationTranslator) type.getDataTypeExtendedInfo();
         if (enumeration.getJavaFileInfo().getPackage() == null) {
@@ -397,10 +397,10 @@
 
         if (!(type.getDataTypeExtendedInfo() instanceof YangIdentityRef)) {
             throw new TranslatorException("type should have been identityref. " +
-                    type.getDataTypeName() + " in " +
-                    type.getLineNumber() + " at " +
-                    type.getCharPosition()
-                    + " in " + type.getFileName());
+                                                  type.getDataTypeName() + " in " +
+                                                  type.getLineNumber() + " at " +
+                                                  type.getCharPosition()
+                                                  + " in " + type.getFileName());
         }
         YangIdentityRef identityRef = (YangIdentityRef) type.getDataTypeExtendedInfo();
         YangJavaIdentityTranslator identity = (YangJavaIdentityTranslator) (identityRef.getReferredIdentity());
@@ -421,10 +421,10 @@
                                                YangToJavaNamingConflictUtil conflictResolver) {
         if (!(parent instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("invalid child node is being processed. " +
-                    parent.getName() + " in " +
-                    parent.getLineNumber() + " at " +
-                    parent.getCharPosition()
-                    + " in " + parent.getFileName());
+                                                  parent.getName() + " in " +
+                                                  parent.getLineNumber() + " at " +
+                                                  parent.getCharPosition()
+                                                  + " in " + parent.getFileName());
         }
         JavaFileInfoTranslator parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo();
         if (parentInfo.getPackage() == null) {
@@ -464,18 +464,18 @@
             if (yangNode instanceof YangJavaModuleTranslator) {
                 YangJavaModuleTranslator module = (YangJavaModuleTranslator) yangNode;
                 pkg = getRootPackage(module.getVersion(), module.getNameSpace(), module
-                        .getRevision().getRevDate(), conflictResolver);
+                        .getRevision(), conflictResolver);
             } else if (yangNode instanceof YangJavaSubModuleTranslator) {
                 YangJavaSubModuleTranslator submodule = (YangJavaSubModuleTranslator) yangNode;
                 pkg = getRootPackage(submodule.getVersion(),
-                        submodule.getNameSpaceFromModule(submodule.getBelongsTo()),
-                        submodule.getRevision().getRevDate(), conflictResolver);
+                                     submodule.getNameSpaceFromModule(),
+                                     submodule.getRevision(), conflictResolver);
             } else {
                 throw new TranslatorException("Invalid root node of data model tree " +
-                        yangNode.getName() + " in " +
-                        yangNode.getLineNumber() + " at " +
-                        yangNode.getCharPosition()
-                        + " in " + yangNode.getFileName());
+                                                      yangNode.getName() + " in " +
+                                                      yangNode.getLineNumber() + " at " +
+                                                      yangNode.getCharPosition()
+                                                      + " in " + yangNode.getFileName());
 
             }
 
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModuleTranslator.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModuleTranslator.java
index cf1f455..6a6ac26 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModuleTranslator.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModuleTranslator.java
@@ -36,6 +36,7 @@
 import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isRootNodesCodeGenRequired;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
 import static org.onosproject.yangutils.utils.UtilConstants.SBI;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.removeEmptyDirectory;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
 
 /**
@@ -77,10 +78,10 @@
     public JavaFileInfoTranslator getJavaFileInfo() {
         if (javaFileInfo == null) {
             throw new TranslatorException("Missing java info in java datamodel node " +
-                    getName() + " in " +
-                    getLineNumber() + " at " +
-                    getCharPosition()
-                    + " in " + getFileName());
+                                                  getName() + " in " +
+                                                  getLineNumber() + " at " +
+                                                  getCharPosition()
+                                                  + " in " + getFileName());
         }
         return (JavaFileInfoTranslator) javaFileInfo;
     }
@@ -122,13 +123,14 @@
      * @throws TranslatorException when fails to generate the source files
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException {
-        String modulePkg = getRootPackage(getVersion(), getNameSpace(), getRevision().getRevDate(),
-                yangPlugin.getConflictResolver());
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws TranslatorException {
+        String modulePkg = getRootPackage(getVersion(), getNameSpace(), getRevision(),
+                                          yangPlugin.getConflictResolver());
 
         if (isNotificationChildNodePresent(this)) {
             getJavaFileInfo().setGeneratedFileTypes(getJavaFileInfo().getGeneratedFileTypes()
-                    | GENERATE_ALL_EVENT_CLASS_MASK);
+                                                            | GENERATE_ALL_EVENT_CLASS_MASK);
         }
         try {
             generateCodeOfRootNode(this, yangPlugin, modulePkg);
@@ -146,7 +148,8 @@
      * Creates a java file using the YANG module info.
      */
     @Override
-    public void generateCodeExit() throws TranslatorException {
+    public void generateCodeExit()
+            throws TranslatorException {
         /*
          * As part of the notification support the following files needs to be generated.
          * 1) Subject of the notification(event), this is simple interface with builder class.
@@ -171,15 +174,15 @@
             }
 
             searchAndDeleteTempDir(getJavaFileInfo().getBaseCodeGenPath() +
-                    getJavaFileInfo().getPackageFilePath());
-            searchAndDeleteTempDir(getJavaFileInfo().getPluginConfig().getCodeGenDir() +
-                    getJavaFileInfo().getPackageFilePath());
+                                           getJavaFileInfo().getPackageFilePath());
+            removeEmptyDirectory(getJavaFileInfo().getBaseCodeGenPath() +
+                                         getJavaFileInfo().getPackageFilePath());
         } catch (IOException e) {
             throw new TranslatorException("Failed to generate code for module node " +
-                    getName() + " in " +
-                    getLineNumber() + " at " +
-                    getCharPosition()
-                    + " in " + getFileName() + " " + e.getLocalizedMessage());
+                                                  getName() + " in " +
+                                                  getLineNumber() + " at " +
+                                                  getCharPosition()
+                                                  + " in " + getFileName() + " " + e.getLocalizedMessage());
         }
     }
 
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModuleTranslator.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModuleTranslator.java
index 4ab4be8..2604262 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModuleTranslator.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModuleTranslator.java
@@ -19,8 +19,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.onosproject.yangutils.datamodel.YangBelongsTo;
-import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangNotification;
 import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaSubModule;
@@ -38,6 +36,7 @@
 import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isRootNodesCodeGenRequired;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
 import static org.onosproject.yangutils.utils.UtilConstants.SBI;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.removeEmptyDirectory;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
 
 /**
@@ -81,10 +80,10 @@
     public JavaFileInfoTranslator getJavaFileInfo() {
         if (javaFileInfo == null) {
             throw new TranslatorException("Missing java info in java datamodel node " +
-                    getName() + " in " +
-                    getLineNumber() + " at " +
-                    getCharPosition()
-                    + " in " + getFileName());
+                                                  getName() + " in " +
+                                                  getLineNumber() + " at " +
+                                                  getCharPosition()
+                                                  + " in " + getFileName());
         }
         return (JavaFileInfoTranslator) javaFileInfo;
     }
@@ -122,11 +121,10 @@
     /**
      * Returns the name space of the module to which the sub module belongs to.
      *
-     * @param belongsToInfo Information of the module to which the sub module belongs
      * @return the name space string of the module.
      */
-    public String getNameSpaceFromModule(YangBelongsTo belongsToInfo) {
-        return ((YangModule) belongsToInfo.getModuleNode()).getNameSpace();
+    public String getNameSpaceFromModule() {
+        return (getBelongsTo().getModuleNode()).getNameSpace();
     }
 
     /**
@@ -136,13 +134,14 @@
      * @throws TranslatorException when fails to translate
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException {
-        String subModulePkg = getRootPackage(getVersion(), getNameSpaceFromModule(getBelongsTo()),
-                getRevision().getRevDate(), yangPlugin.getConflictResolver());
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws TranslatorException {
+        String subModulePkg = getRootPackage(getVersion(), getNameSpaceFromModule(),
+                                             getRevision(), yangPlugin.getConflictResolver());
 
         if (isNotificationChildNodePresent(this)) {
             getJavaFileInfo().setGeneratedFileTypes(getJavaFileInfo().getGeneratedFileTypes()
-                    | GENERATE_ALL_EVENT_CLASS_MASK);
+                                                            | GENERATE_ALL_EVENT_CLASS_MASK);
         }
         try {
             generateCodeOfRootNode(this, yangPlugin, subModulePkg);
@@ -161,7 +160,8 @@
      * Creates a java file using the YANG submodule info.
      */
     @Override
-    public void generateCodeExit() throws TranslatorException {
+    public void generateCodeExit()
+            throws TranslatorException {
         /**
          * As part of the notification support the following files needs to be generated.
          * 1) Subject of the notification(event), this is simple interface with builder class.
@@ -185,15 +185,15 @@
             }
 
             searchAndDeleteTempDir(getJavaFileInfo().getBaseCodeGenPath() +
-                    getJavaFileInfo().getPackageFilePath());
-            searchAndDeleteTempDir(getJavaFileInfo().getPluginConfig().getCodeGenDir() +
-                    getJavaFileInfo().getPackageFilePath());
+                                           getJavaFileInfo().getPackageFilePath());
+            removeEmptyDirectory(getJavaFileInfo().getBaseCodeGenPath() +
+                                         getJavaFileInfo().getPackageFilePath());
         } catch (IOException e) {
             throw new TranslatorException("Failed to generate code for submodule node " +
-                    getName() + " in " +
-                    getLineNumber() + " at " +
-                    getCharPosition()
-                    + " in " + getFileName() + " " + e.getLocalizedMessage());
+                                                  getName() + " in " +
+                                                  getLineNumber() + " at " +
+                                                  getCharPosition()
+                                                  + " in " + getFileName() + " " + e.getLocalizedMessage());
         }
     }
 
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
index ab37d7c..2a2d97a 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
@@ -126,6 +126,8 @@
         .TempJavaFragmentFiles.getCurNodeAsAttributeInTarget;
 import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils
         .getQualifierInfoForCasesParent;
+import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils
+        .isGetSetOfRootNodeRequired;
 import static org.onosproject.yangutils.translator.tojava.utils
         .JavaCodeSnippetGen.addAugmentationAttribute;
 import static org.onosproject.yangutils.translator.tojava.utils
@@ -173,6 +175,8 @@
 import static org.onosproject.yangutils.translator.tojava.utils
         .MethodsGenerator.getGetterForOperationType;
 import static org.onosproject.yangutils.translator.tojava.utils
+        .MethodsGenerator.getGetterString;
+import static org.onosproject.yangutils.translator.tojava.utils
         .MethodsGenerator.getGettersForValueAndSelectLeaf;
 import static org.onosproject.yangutils.translator.tojava.utils
         .MethodsGenerator.getHashCodeMethodClose;
@@ -195,6 +199,8 @@
 import static org.onosproject.yangutils.translator.tojava.utils
         .MethodsGenerator.getSetterForSelectLeaf;
 import static org.onosproject.yangutils.translator.tojava.utils
+        .MethodsGenerator.getSetterString;
+import static org.onosproject.yangutils.translator.tojava.utils
         .MethodsGenerator.getToStringMethodClose;
 import static org.onosproject.yangutils.translator.tojava.utils
         .MethodsGenerator.getToStringMethodOpen;
@@ -1413,6 +1419,19 @@
 
         try {
 
+            if (isGetSetOfRootNodeRequired(curNode)) {
+                //Getter methods.
+                methods.add(getGetterString(rootAttribute,
+                                            GENERATE_SERVICE_AND_MANAGER,
+                                            javaFileInfo.getPluginConfig()) +
+                                    NEW_LINE);
+                // Setter methods.
+                methods.add(getSetterString(rootAttribute, className,
+                                            GENERATE_SERVICE_AND_MANAGER,
+                                            javaFileInfo.getPluginConfig()) +
+                                    NEW_LINE);
+            }
+
             methods.add(getAugmentsDataMethodForService(curNode) + NEW_LINE);
 
             if (((JavaCodeGeneratorInfo) curNode).getTempJavaCodeFragmentFiles()
diff --git a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
index 8c14295..93e26c7 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
@@ -26,6 +26,7 @@
 import java.util.List;
 
 import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfoTranslator;
@@ -78,7 +79,7 @@
      * @param conflictResolver object of YANG to java naming conflict util
      * @return the root package string
      */
-    public static String getRootPackage(byte version, String nameSpace, Date revision,
+    public static String getRootPackage(byte version, String nameSpace, YangRevision revision,
                                         YangToJavaNamingConflictUtil conflictResolver) {
 
         String pkg;
@@ -87,9 +88,10 @@
         pkg = pkg + getYangVersion(version);
         pkg = pkg + PERIOD;
         pkg = pkg + getPkgFromNameSpace(nameSpace, conflictResolver);
-        pkg = pkg + PERIOD;
-        pkg = pkg + getYangRevisionStr(revision);
-
+        if (revision != null) {
+            pkg = pkg + PERIOD;
+            pkg = pkg + getYangRevisionStr(revision.getRevDate());
+        }
         return pkg.toLowerCase();
     }
 
@@ -203,13 +205,14 @@
      * @param yangNode YANG node for which code is being generated
      * @throws IOException any IO exception
      */
-    public static void createPackage(YangNode yangNode) throws IOException {
+    public static void createPackage(YangNode yangNode)
+            throws IOException {
         if (!(yangNode instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("current node must have java file info " +
-                    yangNode.getName() + " in " +
-                    yangNode.getLineNumber() + " at " +
-                    yangNode.getCharPosition()
-                    + " in " + yangNode.getFileName());
+                                                  yangNode.getName() + " in " +
+                                                  yangNode.getLineNumber() + " at " +
+                                                  yangNode.getCharPosition()
+                                                  + " in " + yangNode.getFileName());
         }
         String pkgInfo;
         JavaFileInfoTranslator javaFileInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo();
@@ -221,11 +224,11 @@
                 if (parent != null) {
                     pkgInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName();
                     addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(pkg), true,
-                            ((JavaFileInfoContainer) parent).getJavaFileInfo().getPluginConfig());
+                                   ((JavaFileInfoContainer) parent).getJavaFileInfo().getPluginConfig());
                 } else {
                     pkgInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo().getJavaName();
                     addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(pkg), false,
-                            ((JavaFileInfoContainer) yangNode).getJavaFileInfo().getPluginConfig());
+                                   ((JavaFileInfoContainer) yangNode).getJavaFileInfo().getPluginConfig());
                 }
             } catch (IOException e) {
                 throw new IOException("failed to create package-info file");
diff --git a/plugin/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java b/plugin/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
index 6ac0581..2294b99 100644
--- a/plugin/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
+++ b/plugin/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
@@ -95,7 +95,8 @@
      * @return directory structure
      * @throws IOException when fails to do IO operations
      */
-    public static File createDirectories(String path) throws IOException {
+    public static File createDirectories(String path)
+            throws IOException {
         File generatedDir = new File(path);
         if (!generatedDir.exists()) {
             boolean isGenerated = generatedDir.mkdirs();
@@ -259,7 +260,7 @@
             stringBuilder.replace(index, index + 1, replacingString);
         } else {
             stringBuilder.append(NEW_LINE + EIGHT_SPACE_INDENTATION + UNUSED + OPEN_PARENTHESIS + ONE +
-                    CLOSE_PARENTHESIS + SEMI_COLAN);
+                                         CLOSE_PARENTHESIS + SEMI_COLAN);
         }
         return stringBuilder.toString();
 
@@ -684,15 +685,16 @@
             String replacementForUnderscore = conflictResolver.getReplacementForUnderscore();
             if (replacementForPeriod != null) {
                 yangIdentifier = yangIdentifier.replaceAll(REGEX_FOR_PERIOD,
-                        PERIOD + replacementForPeriod.toLowerCase() + PERIOD);
+                                                           PERIOD + replacementForPeriod.toLowerCase() + PERIOD);
             }
             if (replacementForUnderscore != null) {
                 yangIdentifier = yangIdentifier.replaceAll(REGEX_FOR_UNDERSCORE,
-                        UNDER_SCORE + replacementForUnderscore.toLowerCase() + UNDER_SCORE);
+                                                           UNDER_SCORE + replacementForUnderscore.toLowerCase() +
+                                                                   UNDER_SCORE);
             }
             if (replacementForHyphen != null) {
                 yangIdentifier = yangIdentifier.replaceAll(REGEX_FOR_HYPHEN,
-                        HYPHEN + replacementForHyphen.toLowerCase() + HYPHEN);
+                                                           HYPHEN + replacementForHyphen.toLowerCase() + HYPHEN);
             }
         }
         yangIdentifier = yangIdentifier.replaceAll(REGEX_FOR_IDENTIFIER_SPECIAL_CHAR, COLAN);
@@ -739,4 +741,39 @@
         }
         return prefixForIdentifier;
     }
+
+    /**
+     * Removes empty directory.
+     *
+     * @param path path to be checked
+     */
+    public static void removeEmptyDirectory(String path) {
+        int index;
+        while (path != null && !path.equals("")) {
+            if (!removeDirectory(path)) {
+                break;
+            } else {
+                index = path.lastIndexOf(SLASH);
+                path = path.substring(0, index);
+            }
+        }
+    }
+
+    private static boolean removeDirectory(String path) {
+        File dir = new File(path);
+        boolean isDeleted = false;
+        if (dir.isDirectory()) {
+            File[] files = dir.listFiles();
+            if (files != null && files.length == 0) {
+                isDeleted = dir.delete();
+            } else if (files != null && files.length == 1) {
+                if (files[0].getName().equals("package-info.java")
+                        || files[0].getName().endsWith("-temp")) {
+                    isDeleted = dir.delete();
+                }
+            }
+        }
+        return isDeleted;
+    }
+
 }
diff --git a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListenerTest.java b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListenerTest.java
index fbeacc8..88c4278 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListenerTest.java
+++ b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListenerTest.java
@@ -16,17 +16,17 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import org.junit.Test;
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
 
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
 import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.notNullValue;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -75,7 +75,7 @@
     public void processWithoutRevision() throws IOException, ParserException {
 
         YangNode node = manager.getDataModel("src/test/resources/RevisionAbsence.yang");
-        assertThat(((YangModule) node).getRevision().getRevDate(), notNullValue());
+        assertThat(true, is((node).getRevision() == null));
     }
 
     /**
@@ -85,6 +85,6 @@
     public void processWithMultipleRevision() throws IOException, ParserException, ParseException {
 
         YangNode node = manager.getDataModel("src/test/resources/MultipleRevision.yang");
-        assertThat(((YangModule) node).getRevision().getRevDate(), is(simpleDateFormat.parse("2013-07-15")));
+        assertThat((node).getRevision().getRevDate(), is(simpleDateFormat.parse("2013-07-15")));
     }
 }
\ No newline at end of file
diff --git a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListenerTest.java b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListenerTest.java
index 6a53cbe..3210948 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListenerTest.java
+++ b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListenerTest.java
@@ -26,7 +26,6 @@
 import java.io.IOException;
 
 import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.notNullValue;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -109,7 +108,7 @@
         // Checks for the version value in data model tree.
         assertThat(yangNode.getBelongsTo().getPrefix(), is("On1"));
         //Checks the revision with current date is created for empty revision statement.
-        assertThat(((YangSubModule) node).getRevision().getRevDate(), notNullValue());
+        assertThat(true, is(node.getRevision() == null));
     }
 
     /**
diff --git a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RootClassGeneratorTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RootClassGeneratorTest.java
new file mode 100644
index 0000000..472f083
--- /dev/null
+++ b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RootClassGeneratorTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.plugin.manager;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.junit.Test;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.utils.io.YangPluginConfig;
+import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
+
+import java.io.File;
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
+
+/**
+ * Unit test case for root node's code generation.
+ */
+public class RootClassGeneratorTest {
+
+    private final YangUtilManager utilManager = new YangUtilManager();
+
+    @Test
+    public void rootClassGenTest() throws IOException, ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/manager/singleChild";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/manager/");
+        utilManager.translateToJava(yangPluginConfig);
+
+        String path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test5/test/rev20160704/Test5.java";
+        assertThat(true, is(!(new File(path)).exists()));
+
+        path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test5/test/rev20160704/Test7.java";
+        assertThat(true, is((new File(path)).exists()));
+        deleteDirectory("target/manager/");
+    }
+
+    @Test
+    public void rootClassNoGenTest() throws IOException, ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/manager/nogen";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/manager/");
+        utilManager.translateToJava(yangPluginConfig);
+
+        String path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test5/test/rev20160704/Test5.java";
+
+        assertThat(true, is(!(new File(path)).exists()));
+        deleteDirectory("target/manager/");
+    }
+
+    @Test
+    public void rootClassGenwithoutRevTest() throws IOException, ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/manager/genwithoutrev";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/manager/");
+        utilManager.translateToJava(yangPluginConfig);
+
+        String path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test5/test/Test5.java";
+
+        assertThat(true, is((new File(path)).exists()));
+        deleteDirectory("target/manager/");
+    }
+
+    @Test
+    public void rootClassMethodGenTest() throws IOException, ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/manager/MultiChild";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir("target/manager/");
+        utilManager.translateToJava(yangPluginConfig);
+
+        String path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test5/test/rev20160704/Test5.java";
+        assertThat(true, is(!(new File(path)).exists()));
+
+        path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test5/test/rev20160704/Test7.java";
+        assertThat(true, is(!(new File(path)).exists()));
+
+        path = System.getProperty("user.dir") + "/target/manager/" +
+                "org/onosproject/yang/gen/v1/test8/test/rev20160704/Test8.java";
+        assertThat(true, is((new File(path)).exists()));
+
+        deleteDirectory("target/manager/");
+    }
+}
diff --git a/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangJavaModelUtilsTest.java b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangJavaModelUtilsTest.java
new file mode 100644
index 0000000..daaa074
--- /dev/null
+++ b/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/YangJavaModelUtilsTest.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.plugin.manager;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.junit.Test;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.plugin.manager.YangUtilManager;
+import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
+
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isGetSetOfRootNodeRequired;
+import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.isRootNodesCodeGenRequired;
+
+/**
+ * Unit test case for java model utils.
+ */
+public class YangJavaModelUtilsTest {
+
+
+    private final YangUtilManager utilManager = new YangUtilManager();
+
+    @Test
+    public void isRootNodeContainsOnlyAugmentTest() throws IOException,
+            ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/onlyaugment";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(false, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(true, is(isRootNodesCodeGenRequired(node)));
+            }
+            if (node.getName().equals("test6")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(true, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+    }
+
+    @Test
+    public void isRootNodeCodeGenRequiredOnlyLeafTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/onlyleaf";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(true, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+    }
+
+    @Test
+    public void isRootNodeCodeGenRequiredOnlyLeafListTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/onlyleaflist";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(true, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+    }
+
+    @Test
+    public void isRootNodeCodeGenRequiredOnlyGroupingTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/onlygrouping";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(false, is(isRootNodesCodeGenRequired(node)));
+            }
+            if (node.getName().equals("test6")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(false, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+    }
+
+
+    @Test
+    public void isRootNodeCodeGenRequiredOnlyTypeDefTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/onlytypdef";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(false, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(false, is(isRootNodesCodeGenRequired(node)));
+            }
+            if (node.getName().equals("test6")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(false, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+    }
+
+    @Test
+    public void isRootNodeCodeGenRequiredNoGenTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/nogen";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(false, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(false, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+
+    }
+
+    @Test
+    public void isRootNodeCodeGenRequiredMixedTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/mixed";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(false, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(true, is(isRootNodesCodeGenRequired(node)));
+            }
+            if (node.getName().equals("test6")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(true, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+
+    }
+
+    @Test
+    public void isRootNodeCodeGenRequiredTypedefGroupingTest() throws IOException
+            , ParserException, MojoExecutionException {
+        String searchDir = "src/test/resources/rootNode/typedefgrouping";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+        utilManager.resolveDependenciesUsingLinker();
+
+        for (YangNode node : utilManager.getYangNodeSet()) {
+            if (node.getName().equals("test5")) {
+                assertThat(true, is(isGetSetOfRootNodeRequired(node)));
+                assertThat(false, is(isRootNodesCodeGenRequired(node)));
+            }
+        }
+
+    }
+}
diff --git a/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntaxTest.java b/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntaxTest.java
index 0e15913..ca0bfe9 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntaxTest.java
+++ b/plugin/src/test/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntaxTest.java
@@ -23,9 +23,11 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
+import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.utils.io.YangToJavaNamingConflictUtil;
 
@@ -128,8 +130,9 @@
      *                                   or constructor.
      */
     @Test
-    public void callPrivateConstructors() throws SecurityException, NoSuchMethodException, IllegalArgumentException,
-            InstantiationException, IllegalAccessException, InvocationTargetException {
+    public void callPrivateConstructors()
+            throws SecurityException, NoSuchMethodException, IllegalArgumentException,
+                   InstantiationException, IllegalAccessException, InvocationTargetException {
 
         Class<?>[] classesToConstruct = {JavaIdentifierSyntax.class};
         for (Class<?> clazz : classesToConstruct) {
@@ -143,48 +146,48 @@
      * Unit test for root package generation with revision complexity.
      */
     @Test
-    public void getRootPackageTest() throws ParseException {
+    public void getRootPackageTest()
+            throws ParseException {
         conflictResolver.setPrefixForIdentifier(null);
-        Date date = simpleDateFormat.parse(DATE1);
-        String rootPackage = getRootPackage((byte) 1, CHILD_PACKAGE, date, conflictResolver);
+        String rootPackage = getRootPackage((byte) 1, CHILD_PACKAGE, getYangRevision(DATE1), conflictResolver);
         assertThat(rootPackage.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER
-                + PERIOD + CHILD_WITH_PERIOD + PERIOD + DATE_WITH_REV1), is(true));
+                                              + PERIOD + CHILD_WITH_PERIOD + PERIOD + DATE_WITH_REV1), is(true));
     }
 
     /**
      * Unit test for root package generation with invalid prefix.
      */
     @Test
-    public void getRootPackageWithInvalidPrefix() throws TranslatorException, ParseException {
+    public void getRootPackageWithInvalidPrefix()
+            throws TranslatorException, ParseException {
         thrown.expect(TranslatorException.class);
         thrown.expectMessage("The given prefix in pom.xml is invalid.");
         conflictResolver.setPrefixForIdentifier(INVALID_PREFIX);
-        Date date = simpleDateFormat.parse(DATE1);
-        String rootPackage1 = getRootPackage((byte) 1, INVALID_NAME_SPACE_FOR_INVALID_PREFIX, date,
-                conflictResolver);
+        String rootPackage1 = getRootPackage((byte) 1, INVALID_NAME_SPACE_FOR_INVALID_PREFIX, getYangRevision(DATE1),
+                                             conflictResolver);
     }
 
     /**
      * Unit test for root package generation with special characters presence.
      */
     @Test
-    public void getRootPackageWithSpecialCharactersTest() throws ParseException {
+    public void getRootPackageWithSpecialCharactersTest()
+            throws ParseException {
         conflictResolver.setPrefixForIdentifier(VALID_PREFIX);
-        Date date = simpleDateFormat.parse(DATE1);
-        String rootPackage = getRootPackage((byte) 1, INVALID_NAME_SPACE1, date, conflictResolver);
+        String rootPackage = getRootPackage((byte) 1, INVALID_NAME_SPACE1, getYangRevision(DATE1), conflictResolver);
         assertThat(rootPackage.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER
-                + PERIOD + VALID_NAME_SPACE1 + PERIOD + DATE_WITH_REV1), is(true));
+                                              + PERIOD + VALID_NAME_SPACE1 + PERIOD + DATE_WITH_REV1), is(true));
         conflictResolver.setPrefixForIdentifier(null);
-        String rootPackage1 = getRootPackage((byte) 1, INVALID_NAME_SPACE2, date, conflictResolver);
+        String rootPackage1 = getRootPackage((byte) 1, INVALID_NAME_SPACE2, getYangRevision(DATE1), conflictResolver);
         assertThat(rootPackage1.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER
-                + PERIOD + VALID_NAME_SPACE2 + PERIOD + DATE_WITH_REV1), is(true));
-        String rootPackage2 = getRootPackage((byte) 1, INVALID_NAME_SPACE3, date, conflictResolver);
+                                               + PERIOD + VALID_NAME_SPACE2 + PERIOD + DATE_WITH_REV1), is(true));
+        String rootPackage2 = getRootPackage((byte) 1, INVALID_NAME_SPACE3, getYangRevision(DATE1), conflictResolver);
         assertThat(rootPackage2.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER
-                + PERIOD + VALID_NAME_SPACE4 + PERIOD + DATE_WITH_REV1), is(true));
+                                               + PERIOD + VALID_NAME_SPACE4 + PERIOD + DATE_WITH_REV1), is(true));
         conflictResolver.setPrefixForIdentifier(INVALID_PREFIX1);
-        String rootPackage3 = getRootPackage((byte) 1, INVALID_NAME_SPACE2, date, conflictResolver);
+        String rootPackage3 = getRootPackage((byte) 1, INVALID_NAME_SPACE2, getYangRevision(DATE1), conflictResolver);
         assertThat(rootPackage3.equals(DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER
-                + PERIOD + VALID_NAME_SPACE3 + PERIOD + DATE_WITH_REV1), is(true));
+                                               + PERIOD + VALID_NAME_SPACE3 + PERIOD + DATE_WITH_REV1), is(true));
 
     }
 
@@ -192,12 +195,13 @@
      * Unit test for root package generation without complexity in revision.
      */
     @Test
-    public void getRootPackageWithRevTest() throws ParseException {
+    public void getRootPackageWithRevTest()
+            throws ParseException {
         Date date = simpleDateFormat.parse(DATE2);
-        String rootPkgWithRev = getRootPackage((byte) 1, CHILD_PACKAGE, date, null);
+        String rootPkgWithRev = getRootPackage((byte) 1, CHILD_PACKAGE, getYangRevision(DATE2), null);
         assertThat(rootPkgWithRev.equals(
                 DEFAULT_BASE_PKG + PERIOD + VERSION_NUMBER + PERIOD + CHILD_WITH_PERIOD + PERIOD + DATE_WITH_REV2),
-                is(true));
+                   is(true));
     }
 
     /**
@@ -265,7 +269,8 @@
      * Unit test for getting the camel case along with the invalid prefix provided.
      */
     @Test
-    public void getCamelCaseWithInvalidPrefixTest() throws TranslatorException {
+    public void getCamelCaseWithInvalidPrefixTest()
+            throws TranslatorException {
 
         thrown.expect(TranslatorException.class);
         thrown.expectMessage("The given prefix in pom.xml is invalid.");
@@ -307,7 +312,8 @@
      * @throws IOException when failed to create a test file
      */
     @Test
-    public void packageExistTest() throws IOException {
+    public void packageExistTest()
+            throws IOException {
 
         String strPath = BASE_DIR_PKG + DIR_PATH;
         File createDir = new File(strPath.replace(PERIOD, SLASH));
@@ -319,4 +325,14 @@
         deleteDirectory(createDir);
         deleteDirectory(new File(BASE_DIR_PKG.replace(PERIOD, SLASH)));
     }
+
+    private YangRevision getYangRevision(String date) {
+        YangRevision revision = new YangRevision();
+        try {
+            revision.setRevDate(simpleDateFormat.parse(date));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return revision;
+    }
 }
diff --git a/plugin/src/test/resources/manager/genwithoutrev/module.yang b/plugin/src/test/resources/manager/genwithoutrev/module.yang
new file mode 100644
index 0000000..bcc1cc7
--- /dev/null
+++ b/plugin/src/test/resources/manager/genwithoutrev/module.yang
@@ -0,0 +1,9 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    leaf a-leaf {
+       type int32;
+    }
+    
+}
diff --git a/plugin/src/test/resources/manager/nogen/module.yang b/plugin/src/test/resources/manager/nogen/module.yang
new file mode 100644
index 0000000..97d79b6
--- /dev/null
+++ b/plugin/src/test/resources/manager/nogen/module.yang
@@ -0,0 +1,9 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    
+}
diff --git a/plugin/src/test/resources/rootNode/mixed/module.yang b/plugin/src/test/resources/rootNode/mixed/module.yang
new file mode 100644
index 0000000..e3e5571
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/mixed/module.yang
@@ -0,0 +1,21 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    include test6;
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    
+    augment /cont1 {
+       leaf cont1 {
+          type string;
+        }
+    }
+    augment /cont2 {
+       leaf cont2 {
+          type string;
+        }
+    }	
+
+}
diff --git a/plugin/src/test/resources/rootNode/mixed/submodule.yang b/plugin/src/test/resources/rootNode/mixed/submodule.yang
new file mode 100644
index 0000000..e7c497e
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/mixed/submodule.yang
@@ -0,0 +1,25 @@
+submodule test6 {
+      
+     belongs-to "test5" {
+         prefix "test";
+    }    
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+
+    typedef typedef {
+        type int32;
+    }
+    container cont1 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+    container cont2 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+
+}
diff --git a/plugin/src/test/resources/rootNode/nogen/module.yang b/plugin/src/test/resources/rootNode/nogen/module.yang
new file mode 100644
index 0000000..97d79b6
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/nogen/module.yang
@@ -0,0 +1,9 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    
+}
diff --git a/plugin/src/test/resources/rootNode/onlyaugment/module.yang b/plugin/src/test/resources/rootNode/onlyaugment/module.yang
new file mode 100644
index 0000000..e3e5571
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlyaugment/module.yang
@@ -0,0 +1,21 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    include test6;
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    
+    augment /cont1 {
+       leaf cont1 {
+          type string;
+        }
+    }
+    augment /cont2 {
+       leaf cont2 {
+          type string;
+        }
+    }	
+
+}
diff --git a/plugin/src/test/resources/rootNode/onlyaugment/submodule.yang b/plugin/src/test/resources/rootNode/onlyaugment/submodule.yang
new file mode 100644
index 0000000..9acc939
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlyaugment/submodule.yang
@@ -0,0 +1,21 @@
+submodule test6 {
+      
+     belongs-to "test5" {
+         prefix "test";
+    }    
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    container cont1 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+    container cont2 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+
+}
diff --git a/plugin/src/test/resources/rootNode/onlygrouping/module.yang b/plugin/src/test/resources/rootNode/onlygrouping/module.yang
new file mode 100644
index 0000000..1c4637c
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlygrouping/module.yang
@@ -0,0 +1,18 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    typedef typedef1 {
+       type int32;
+    }
+    typedef typedef2 {
+       type int32;
+    }
+    typedef typedef3 {
+       type int32;
+    }
+
+}
diff --git a/plugin/src/test/resources/rootNode/onlygrouping/submodule.yang b/plugin/src/test/resources/rootNode/onlygrouping/submodule.yang
new file mode 100644
index 0000000..92d7c21
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlygrouping/submodule.yang
@@ -0,0 +1,26 @@
+submodule test6 {
+      
+     belongs-to "test5" {
+         prefix "test";
+    }    
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    grouping grouping1 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+    grouping grouping2 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+
+   grouping grouping3 {
+        leaf leaf1 {
+           type int32;
+        }
+    }
+}
diff --git a/plugin/src/test/resources/rootNode/onlyleaf/module.yang b/plugin/src/test/resources/rootNode/onlyleaf/module.yang
new file mode 100644
index 0000000..61864ad
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlyleaf/module.yang
@@ -0,0 +1,15 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    leaf a-leaf {
+       type int32;
+     }
+    leaf b-leaf {
+       type int32;
+     }
+    
+}
diff --git a/plugin/src/test/resources/rootNode/onlyleaflist/module.yang b/plugin/src/test/resources/rootNode/onlyleaflist/module.yang
new file mode 100644
index 0000000..d8cf6b3
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlyleaflist/module.yang
@@ -0,0 +1,15 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    leaf-list a-leaf {
+       type int32;
+     }
+    leaf-list b-leaf {
+       type int32;
+     }
+    
+}
diff --git a/plugin/src/test/resources/rootNode/onlytypedef/module.yang b/plugin/src/test/resources/rootNode/onlytypedef/module.yang
new file mode 100644
index 0000000..1c4637c
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/onlytypedef/module.yang
@@ -0,0 +1,18 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    typedef typedef1 {
+       type int32;
+    }
+    typedef typedef2 {
+       type int32;
+    }
+    typedef typedef3 {
+       type int32;
+    }
+
+}
diff --git a/plugin/src/test/resources/rootNode/typedefgrouping/module.yang b/plugin/src/test/resources/rootNode/typedefgrouping/module.yang
new file mode 100644
index 0000000..b54ad47
--- /dev/null
+++ b/plugin/src/test/resources/rootNode/typedefgrouping/module.yang
@@ -0,0 +1,17 @@
+module test5 {
+    namespace "test5:test";
+    prefix test ;
+
+    revision "2016-07-04" {
+             description "Initial revision.";
+    }
+    typedef typedef1 {
+       type int32;
+    }
+    grouping group1 {
+      leaf typedef-leaf {
+          type typedef1;
+       }
+    }
+
+}