@Test public void test_unique_identifier_equivalence() { IdentifierTreeImpl id = new CustomIdentifierTreeImpl(null, "abc"); assertThat(areEquivalent(id, new IdentifierTreeImpl(null, "abc"))).isFalse(); assertThat(areEquivalent(id, id)).isTrue(); assertThat(areEquivalent(id, new CustomIdentifierTreeImpl(null, "abc"))).isTrue(); assertThat(areEquivalent(id, new CustomIdentifierTreeImpl(null, "ABc"))).isTrue(); assertThat(areEquivalent(id, new CustomIdentifierTreeImpl(null, "ABC"))).isTrue(); assertThat(areEquivalent(id, new CustomIdentifierTreeImpl(null, "a"))).isFalse(); }
public static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second) { if (first == second) { return true; } if (first == null || second == null || first.size() != second.size()) { return false; } for (int i = 0; i < first.size(); i++) { if (!areEquivalent(first.get(i), second.get(i))) { return false; } } return true; }
SyntacticEquivalence { public static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second) { if (first == second) { return true; } if (first == null || second == null || first.size() != second.size()) { return false; } for (int i = 0; i < first.size(); i++) { if (!areEquivalent(first.get(i), second.get(i))) { return false; } } return true; } }
SyntacticEquivalence { public static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second) { if (first == second) { return true; } if (first == null || second == null || first.size() != second.size()) { return false; } for (int i = 0; i < first.size(); i++) { if (!areEquivalent(first.get(i), second.get(i))) { return false; } } return true; } private  SyntacticEquivalence(); }
SyntacticEquivalence { public static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second) { if (first == second) { return true; } if (first == null || second == null || first.size() != second.size()) { return false; } for (int i = 0; i < first.size(); i++) { if (!areEquivalent(first.get(i), second.get(i))) { return false; } } return true; } private  SyntacticEquivalence(); static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second); static boolean areEquivalent(@Nullable Tree first, @Nullable Tree second); static String getUniqueIdentifier(IdentifierTree identifier); static List<List<Tree>> findDuplicatedGroups(List<Tree> list); }
SyntacticEquivalence { public static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second) { if (first == second) { return true; } if (first == null || second == null || first.size() != second.size()) { return false; } for (int i = 0; i < first.size(); i++) { if (!areEquivalent(first.get(i), second.get(i))) { return false; } } return true; } private  SyntacticEquivalence(); static boolean areEquivalent(@Nullable List<? extends Tree> first, @Nullable List<? extends Tree> second); static boolean areEquivalent(@Nullable Tree first, @Nullable Tree second); static String getUniqueIdentifier(IdentifierTree identifier); static List<List<Tree>> findDuplicatedGroups(List<Tree> list);  }