### Question:
SignatureParser { public void querySignature(String query, StringBuilder signature, boolean preparedStatement) { querySignature(query, signature, null, preparedStatement); }  void querySignature(String query, StringBuilder signature, boolean preparedStatement); void querySignature(String query, StringBuilder signature, @Nullable StringBuilder dbLink, boolean preparedStatement);  }### Answer:
@Test void testDbLinkForUpdate() { final StringBuilder sb = new StringBuilder(); final StringBuilder dblink = new StringBuilder(); signatureParser.querySignature("UPDATE foo.bar@\"DBLINK.FQDN.COM@USER\" SET bar=1 WHERE baz=2", sb, dblink, false); assertThat(dblink.toString()).isEqualTo("DBLINK.FQDN.COM@USER"); }
@Test void testDbLink() { final StringBuilder sb = new StringBuilder(); final StringBuilder dblink = new StringBuilder(); signatureParser.querySignature("SELECT * FROM TABLE1@DBLINK", sb, dblink, false); assertThat(dblink.toString()).isEqualTo("DBLINK"); }
@Test void testDbLinkCache() { final StringBuilder sb = new StringBuilder(); final StringBuilder dblink = new StringBuilder(); signatureParser.querySignature("SELECT * FROM TABLE1@DBLINK", sb, dblink, true); assertThat(dblink.toString()).isEqualTo("DBLINK"); sb.setLength(0); dblink.setLength(0); signatureParser.querySignature("SELECT * FROM TABLE1@DBLINK", sb, dblink, true); assertThat(dblink.toString()).isEqualTo("DBLINK"); }
@Test void testDbLinkFqdn() { final StringBuilder sb = new StringBuilder(); final StringBuilder dblink = new StringBuilder(); signatureParser.querySignature("SELECT * FROM TABLE1@\"DBLINK.FQDN.COM\"", sb, dblink, false); assertThat(dblink.toString()).isEqualTo("DBLINK.FQDN.COM"); }
@Test void testDbLinkFqdnWithUser() { final StringBuilder sb = new StringBuilder(); final StringBuilder dblink = new StringBuilder(); signatureParser.querySignature("SELECT * FROM TABLE1@\"DBLINK.FQDN.COM@USER\"", sb, dblink, false); assertThat(dblink.toString()).isEqualTo("DBLINK.FQDN.COM@USER"); }