### Question:
IdGenerator { public static List<BigInteger> generateNamespacePath(String namespacePath) { String[] parts = namespacePath.split(Pattern.quote(".")); List<BigInteger> path = new ArrayList<>(); if (parts.length == 0) { throw new IllegalIdentifierException("invalid namespace path"); } BigInteger namespaceId = BigInteger.valueOf(0); for (String part : parts) { namespaceId = generateNamespaceId(part, namespaceId); path.add(namespaceId); } return path; } private  IdGenerator(); static BigInteger generateMosaicId(final int nonce, final byte[] publicKey); static BigInteger generateNamespaceId(
      final String namespaceName, final BigInteger parentId); static BigInteger generateNamespaceId(String namespaceName, String parentNamespaceName); static BigInteger generateNamespaceId(String namespacePath); static List<BigInteger> generateNamespacePath(String namespacePath);  }### Answer:
@Test void namespacePathGeneratesCorrectWellKnownChildPath() { List<BigInteger> ids = IdGenerator.generateNamespacePath("nem.subnem"); assertEquals(2, ids.size()); assertEquals(new BigInteger("9562080086528621131"), ids.get(0)); assertEquals(new BigInteger("16440672666685223858"), ids.get(1)); }
@Test void namespacePathInvalid() { assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath(""); }, "having zero length"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath("alpha.bet@.zeta"); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath("a!pha.beta.zeta"); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath("alpha.beta.ze^a"); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath("."); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath(".."); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath(".a"); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath("a..a"); }, "invalid part"); assertThrows( IllegalIdentifierException.class, () -> { IdGenerator.generateNamespacePath("A"); }, "invalid part"); }