CugUtil implements CugConstants { static boolean definesCug(@NotNull Tree tree) { return tree.exists() && REP_CUG_POLICY.equals(tree.getName()) && NT_REP_CUG_POLICY.equals(TreeUtil.getPrimaryTypeName(tree)); } private  CugUtil();   }
@Test public void testDefinesCug() throws Exception { assertFalse(CugUtil.definesCug(root.getTree(PathUtils.concat(INVALID_PATH, REP_CUG_POLICY)))); assertTrue(CugUtil.definesCug(root.getTree(PathUtils.concat(SUPPORTED_PATH, REP_CUG_POLICY)))); Tree invalid = TreeUtil.addChild(root.getTree(SUPPORTED_PATH2), REP_CUG_POLICY, NodeTypeConstants.NT_OAK_UNSTRUCTURED); assertFalse(CugUtil.definesCug(invalid)); }