### Question:
SchemaMigrations { static ConfigurationTransformation twoTo3() { final Map<String, List<Map.Entry<String, Integer>>> convertedRanks = new HashMap<>(); return ConfigurationTransformation.chain( tBuilder() .addAction(new Object[]{WILDCARD_OBJECT}, (nodePath, configurationNode) -> { if (configurationNode.isMap()) { String lastPath = nodePath.get(0).toString(); if (lastPath.endsWith("s")) { lastPath = lastPath.substring(0, lastPath.length() - 1); } return new Object[]{"subjects", lastPath}; } else { return null; } }).build(), tBuilder() .addAction(new Object[]{"subjects", "group", WILDCARD_OBJECT}, (nodePath, configurationNode) -> { for (ConfigurationNode child : configurationNode.getChildrenList()) { if (child.getNode(FileSubjectData.KEY_CONTEXTS).isVirtual() || child.getNode(FileSubjectData.KEY_CONTEXTS).getChildrenMap().isEmpty()) { ConfigurationNode optionsNode = child.getNode("options"); if (optionsNode.isVirtual()) { return null; } ConfigurationNode rank = optionsNode.getNode("rank"); if (!rank.isVirtual()) { final String rankLadder = optionsNode.getNode("rank-ladder").getString("default"); List<Map.Entry<String, Integer>> tempVals = convertedRanks.computeIfAbsent(rankLadder.toLowerCase(), k -> new ArrayList<>()); tempVals.add(Maps.immutableEntry(configurationNode.getKey().toString(), rank.getInt())); rank.setValue(null); optionsNode.getNode("rank-ladder").setValue(null); if (optionsNode.getChildrenMap().isEmpty()) { optionsNode.setValue(null); } } } } return null; }).build(), tBuilder().addAction(new Object[0], (nodePath, configurationNode) -> { for (Map.Entry<String, List<Map.Entry<String, Integer>>> ent : convertedRanks.entrySet()) { ent.getValue().sort((a, b) -> b.getValue().compareTo(a.getValue())); ConfigurationNode ladderNode = configurationNode.getNode(FileDataStore.KEY_RANK_LADDERS, ent.getKey()); for (Map.Entry<String, Integer> grp : ent.getValue()) { ladderNode.appendListNode().setValue("group:" + grp.getKey()); } } return null; }).build()); } private  SchemaMigrations();  static final int LATEST_VERSION; }### Answer:
@Test public void testTwoToThree(@TempDir Path tempDir) throws IOException { doTest("test2to3.pre.json", "test2to3.post.json", tempDir, SchemaMigrations.twoTo3()); }