### Question:
CypherUtil { public String resolveNodeIris(String cypher) { String resolvedCypher = cypher; Pattern p = Pattern.compile("\\{\\s*iri\\s*:\\s*['|\"]([\\w:/\\?=]+)['|\"]\\s*\\}"); Matcher m = p.matcher(cypher); while (m.find()) { String curie = m.group(1); String iri = curieUtil.getIri(curie).orElse(curie); resolvedCypher = resolvedCypher.replace(curie, iri); } return resolvedCypher; } @Inject  CypherUtil(GraphDatabaseService graphDb, CurieUtil curieUtil); Result execute(String query, Multimap<String, Object> params, long timeout, TimeUnit unit); Result execute(String query, long timeout, TimeUnit unit); Result execute(String query, Multimap<String, Object> params); Result execute(String query); Set<RelationshipType> getEntailedRelationshipTypes(Collection<String> parents); @Deprecated String resolveStartQuery(String cypher); String resolveNodeIris(String cypher); String resolveRelationships(String cypher); Map<String, String> getCurieMap();  }### Answer:
@Test public void resolveMatchQueryWithSingleMatch() { String cypher = "MATCH (n{iri:'FOO:foo'}) RETURN n"; assertThat(util.resolveNodeIris(cypher), IsEqual .equalTo("MATCH (n{iri:'http: }
@Test public void resolveMatchQueryWithMultipleNodes() { String cypher = "MATCH (n{iri:'FOO:foo'})-[]-(m{iri:'FOO:fizz'}) RETURN n,m"; assertThat( util.resolveNodeIris(cypher), IsEqual .equalTo("MATCH (n{iri:'http: }
@Test public void resolveMatchQueryWithMultipleMatches() { String cypher = "MATCH (n{iri:'FOO:foo'}) MATCH (m{iri:'FOO:fizz'}) RETURN n,m"; assertThat( util.resolveNodeIris(cypher), IsEqual .equalTo("MATCH (n{iri:'http: }
@Test public void notResolveMatchQueryWithIris() { String cypher = "MATCH (n{iri:'http: assertThat( util.resolveNodeIris(cypher), IsEqual .equalTo("MATCH (n{iri:'http: }
@Test public void unalterRandomString() { String cypher = "foo"; assertThat(util.resolveNodeIris(cypher), IsEqual.equalTo("foo")); }