### Question:
NodeSchemaManager { public String complete(String path) { if (!enforcePrefix) { return null; } String normalizedPath = NetUtils.normalize(path); String[] subPath = normalizedPath.split(NetConstants.PATH_SEPARATOR_STR); if ((subPath.length) == maxLevel) { return path; } StringBuffer newPath = new StringBuffer(NetConstants.ROOT); int i, j; for (i = 1, j = 1; i < subPath.length && j < (allSchema.size() - 1);) { if (allSchema.get(j).matchPrefix(subPath[i])) { newPath.append(NetConstants.PATH_SEPARATOR_STR + subPath[i]); i++; j++; } else { newPath.append(allSchema.get(j).getDefaultName()); j++; } } if (i == (subPath.length - 1)) { newPath.append(NetConstants.PATH_SEPARATOR_STR + subPath[i]); return newPath.toString(); } return null; } private  NodeSchemaManager(); static NodeSchemaManager getInstance(); void init(ConfigurationSource conf); @VisibleForTesting void init(NodeSchema[] schemas, boolean enforce); int getMaxLevel(); int getCost(int level); String complete(String path);  }### Answer:
@Test public void testComplete() { String path = "/node1"; assertEquals(DEFAULT_RACK + DEFAULT_NODEGROUP + path, manager.complete(path)); assertEquals("/rack" + DEFAULT_NODEGROUP + path, manager.complete("/rack" + path)); assertEquals(DEFAULT_RACK + "/nodegroup" + path, manager.complete("/nodegroup" + path)); assertEquals(null, manager.complete("/dc" + path)); }