Source:
<code>public Settings overrideSettings(final Settings settings) { final String nameOfTest = name.getMethodName(); switch (nameOfTest) { case "shouldRebindTraversalSourceVariables": try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); settings.scriptEngines.get("gremlin-groovy").scripts = Arrays.asList(p); } catch (Exception ex) { throw new RuntimeException(ex); } break; case "shouldWorkOverNioTransport": settings.channelizer = NioChannelizer.class.getName(); break; case "shouldFailWithBadClientSideSerialization": final List<String> custom = Arrays.asList( JsonBuilder.class.getName() + ";" + JsonBuilderGryoSerializer.class.getName(), java.awt.Color.class.getName()); settings.serializers.stream().filter(s -> s.config.containsKey("custom")) .findFirst().get().config.put("custom", custom); break; case "shouldExecuteScriptInSessionOnTransactionalGraph": case "shouldExecuteSessionlessScriptOnTransactionalGraph": case "shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph": deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break; <START> case "shouldExecuteInSessionAndSessionlessWithoutOpeningTransaction": <END> deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break; } return settings; }</code><technical_language>@PommeVerte note fold this case neo4j initialization code is same. basically: java case "shouldExecuteScriptInSessionOnTransactionalGraph": case "shouldExecuteSessionlessScriptOnTransactionalGraph": case "shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph": case "shouldExecuteInSessionAndSessionlessWithoutOpeningTransaction": deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break;</technical_language>

Target:
public Settings overrideSettings(final Settings settings) { final String nameOfTest = name.getMethodName(); switch (nameOfTest) { case "shouldRebindTraversalSourceVariables": try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); settings.scriptEngines.get("gremlin-groovy").scripts = Arrays.asList(p); } catch (Exception ex) { throw new RuntimeException(ex); } break; case "shouldWorkOverNioTransport": settings.channelizer = NioChannelizer.class.getName(); break; case "shouldFailWithBadClientSideSerialization": final List<String> custom = Arrays.asList( JsonBuilder.class.getName() + ";" + JsonBuilderGryoSerializer.class.getName(), java.awt.Color.class.getName()); settings.serializers.stream().filter(s -> s.config.containsKey("custom")) .findFirst().get().config.put("custom", custom); break; case "shouldExecuteScriptInSessionOnTransactionalGraph": case "shouldExecuteSessionlessScriptOnTransactionalGraph": case "shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph": case "shouldExecuteInSessionAndSessionlessWithoutOpeningTransaction": deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break; } return settings; }