### Question:
StandardDdlParser implements DdlParser, DdlConstants, DdlConstants.StatementStartPhrases { protected boolean isTableConstraint( DdlTokenStream tokens ) throws ParsingException { boolean result = false; if ((tokens.matches("PRIMARY", "KEY")) || (tokens.matches("FOREIGN", "KEY")) || (tokens.matches("UNIQUE"))) { result = true; } else if (tokens.matches("CONSTRAINT")) { if (tokens.matches("CONSTRAINT", DdlTokenStream.ANY_VALUE, "UNIQUE") || tokens.matches("CONSTRAINT", DdlTokenStream.ANY_VALUE, "PRIMARY", "KEY") || tokens.matches("CONSTRAINT", DdlTokenStream.ANY_VALUE, "FOREIGN", "KEY") || tokens.matches("CONSTRAINT", DdlTokenStream.ANY_VALUE, "CHECK")) { result = true; } } return result; } StandardDdlParser(); DataTypeParser getDatatypeParser(); void setDatatypeParser( DataTypeParser datatypeParser ); AstNodeFactory nodeFactory(); AstNode getRootNode(); void setRootNode( AstNode rootNode ); Object score( String ddl,
                         String fileName,
                         DdlParserScorer scorer ); String[] getIdentifyingKeywords(); void parse( String ddl,
                       AstNode rootNode,
                       Object scoreReturnObject ); final void addProblem( DdlParserProblem problem,
                                  AstNode node ); final void addProblem( DdlParserProblem problem ); final List<DdlParserProblem> getProblems(); final void attachNewProblem( DdlParserProblem problem,
                                        AstNode parentNode ); void mergeNodes( DdlTokenStream tokens,
                            AstNode firstNode,
                            AstNode secondNode ); AstNode handleUnknownToken( DdlTokenStream tokens,
                                       String tokenValue ); final AstNode unknownTerminatedNode( AstNode parentNode ); final AstNode missingTerminatorNode( AstNode parentNode ); final boolean isMissingTerminatorNode( AstNode node ); final boolean isValidSchemaChild( AstNode node ); final boolean setAsSchemaChildNode( AstNode statementNode,
                                               boolean stmtIsMissingTerminator ); boolean doUseTerminator(); void setDoUseTerminator( boolean useTerminator ); String getStatementTypeName( String[] stmtPhrase ); final Position getCurrentMarkedPosition(); final void markStartOfStatement( DdlTokenStream tokens ); final void markEndOfStatement( DdlTokenStream tokens,
                                          AstNode statementNode ); boolean isTestMode(); void setTestMode( boolean testMode ); String getId(); @Override int hashCode(); @Override boolean equals( Object obj );  }### Answer:
@Test public void isTableConstraint() { printTest("isTableConstraint()"); String content = "PRIMARY KEY"; DdlTokenStream tokens = getTokens(content); boolean result = parser.isTableConstraint(tokens); assertTrue(result); content = "FOREIGN KEY"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertTrue(result); content = "UNIQUE"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertTrue(result); content = "CONSTRAINT constraint_name PRIMARY KEY"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertTrue(result); content = "CONSTRAINT constraint_name FOREIGN KEY"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertTrue(result); content = "CONSTRAINT constraint_name UNIQUE"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertTrue(result); content = "XXXXX"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertFalse(result); content = "CONSTRAINT constraint_name XXXXX"; tokens = getTokens(content); result = parser.isTableConstraint(tokens); assertFalse(result); }