StringUtility { public static String composeFullyQualifiedTableName(String catalog, String schema, String tableName, char separator) { StringBuilder sb = new StringBuilder(); if (stringHasValue(catalog)) { sb.append(catalog); sb.append(separator); } if (stringHasValue(schema)) { sb.append(schema); sb.append(separator); } else { if (sb.length() > 0) { sb.append(separator); } } sb.append(tableName); return sb.toString(); } private  StringUtility(); static boolean stringHasValue(String s); static String composeFullyQualifiedTableName(String catalog,
            String schema, String tableName, char separator); static boolean stringContainsSpace(String s); static String escapeStringForJava(String s); static String escapeStringForKotlin(String s); static String escapeStringForXml(String s); static boolean isTrue(String s); static boolean stringContainsSQLWildcard(String s);  }
@Test public void testNoCatalog() { String answer = StringUtility.composeFullyQualifiedTableName(null, "schema", "table", '.'); assertEquals("schema.table", answer); }
@Test public void testNoSchema() { String answer = StringUtility.composeFullyQualifiedTableName("catalog", null, "table", '.'); assertEquals("catalog..table", answer); }
@Test public void testAllPresent() { String answer = StringUtility.composeFullyQualifiedTableName("catalog", "schema", "table", '.'); assertEquals("catalog.schema.table", answer); }
@Test public void testTableOnly() { String answer = StringUtility.composeFullyQualifiedTableName(null, null, "table", '.'); assertEquals("table", answer); }