### Question:
TableMeta { public boolean containsPK(List<String> cols) { if (cols == null) { return false; } List<String> pk = getPrimaryKeyOnlyName(); if (pk.isEmpty()) { return false; } if (cols.containsAll(pk)) { return true; } else { return CollectionUtils.toUpperList(cols).containsAll(CollectionUtils.toUpperList(pk)); } }  String getTableName(); void setTableName(String tableName); ColumnMeta getColumnMeta(String colName); Map<String, ColumnMeta> getAllColumns(); Map<String, IndexMeta> getAllIndexes(); ColumnMeta getAutoIncreaseColumn(); Map<String, ColumnMeta> getPrimaryKeyMap(); @SuppressWarnings("serial") List<String> getPrimaryKeyOnlyName(); List<String> getEscapePkNameList(String dbType); boolean containsPK(List<String> cols); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testContainsPK() { TableMeta tableMeta = new TableMeta(); Assertions.assertFalse(tableMeta.containsPK(null)); Throwable exception = Assertions.assertThrows(NotSupportYetException.class, () -> tableMeta.containsPK(Lists.newArrayList("id"))); Assertions.assertEquals(tableMeta.getTableName() + " needs to contain the primary key.", exception.getMessage()); IndexMeta primary = new IndexMeta(); primary.setIndextype(IndexType.PRIMARY); ColumnMeta columnMeta = new ColumnMeta(); columnMeta.setColumnName("id"); primary.setValues(Lists.newArrayList(columnMeta)); tableMeta.getAllIndexes().put("id", primary); Assertions.assertTrue(tableMeta.containsPK(Lists.newArrayList("id"))); Assertions.assertTrue(tableMeta.containsPK(Lists.newArrayList("ID"))); }