### Question:
IdentifierParser { public String[] parse(String identifierAsString) { currentState = new NormalState(); for (int i = 0; i < identifierAsString.length(); i++) { char c = identifierAsString.charAt(i); currentState.process(c); } if (part.length() != 0) { parts.add(part); } return parts.toArray(new String[0]); } IdentifierParser(char separatorChar); String[] parse(String identifierAsString);  }### Answer:
@Test void shouldParseSimpleIdentifierString() { final String simpleIdentifier = "myschema"; final IdentifierParser identifierParser = new IdentifierParser('.'); final String[] parsedIdentifier = identifierParser.parse(simpleIdentifier); assertArrayEquals(new String[] {simpleIdentifier}, parsedIdentifier); }
@Test void shouldParseIdentifierWithSeparators() { final String identifier = "myschema.schema.my"; final IdentifierParser identifierParser = new IdentifierParser('.'); final String[] parsedIdentifier = identifierParser.parse(identifier); assertArrayEquals(new String[] {"myschema", "schema", "my"}, parsedIdentifier); }
@Test void shouldParseIdentifierWithSingelQuotesAndSeperator() { final String identifier = "'myschema.schema'.my"; final IdentifierParser identifierParser = new IdentifierParser('.'); final String[] parsedIdentifier = identifierParser.parse(identifier); assertArrayEquals(new String[] {"'myschema.schema'", "my"}, parsedIdentifier); }
@Test void shouldParseIdentifierWithDoubleQuotesAndSeperator() { final String identifier = "\"myschema.schema\".my"; final IdentifierParser identifierParser = new IdentifierParser('.'); final String[] parsedIdentifier = identifierParser.parse(identifier); assertArrayEquals(new String[] {"\"myschema.schema\"", "my"}, parsedIdentifier); }