@Test @DisplayName("Changed code does not equals") void testSimple(){ final var s1 = "int i"; final var s2 = "float i"; Assertions.assertTrue( new Comparator().test(sourceList(s1), sourceList(s2))); }
@Override public boolean test(List<String> strings1, List<String> strings2) { if (strings1.equals(strings2)) return false; final Lexer lexer; if (checkComments) { lexer = new Lexer().commentSensitive(); } else { lexer = new Lexer(); } LexicalElement[] elements1 = lexer.apply(strings1); LexicalElement[] elements2 = lexer.apply(strings2); if (elements1.length != elements2.length) { return true; } for (int i = 0; i < elements1.length; i++) { if (!elements1[i].equals(elements2[i])) { return true; } } return false; }
Comparator implements BiPredicate<List<String>, List<String>> { @Override public boolean test(List<String> strings1, List<String> strings2) { if (strings1.equals(strings2)) return false; final Lexer lexer; if (checkComments) { lexer = new Lexer().commentSensitive(); } else { lexer = new Lexer(); } LexicalElement[] elements1 = lexer.apply(strings1); LexicalElement[] elements2 = lexer.apply(strings2); if (elements1.length != elements2.length) { return true; } for (int i = 0; i < elements1.length; i++) { if (!elements1[i].equals(elements2[i])) { return true; } } return false; } }
Comparator implements BiPredicate<List<String>, List<String>> { @Override public boolean test(List<String> strings1, List<String> strings2) { if (strings1.equals(strings2)) return false; final Lexer lexer; if (checkComments) { lexer = new Lexer().commentSensitive(); } else { lexer = new Lexer(); } LexicalElement[] elements1 = lexer.apply(strings1); LexicalElement[] elements2 = lexer.apply(strings2); if (elements1.length != elements2.length) { return true; } for (int i = 0; i < elements1.length; i++) { if (!elements1[i].equals(elements2[i])) { return true; } } return false; }  }
Comparator implements BiPredicate<List<String>, List<String>> { @Override public boolean test(List<String> strings1, List<String> strings2) { if (strings1.equals(strings2)) return false; final Lexer lexer; if (checkComments) { lexer = new Lexer().commentSensitive(); } else { lexer = new Lexer(); } LexicalElement[] elements1 = lexer.apply(strings1); LexicalElement[] elements2 = lexer.apply(strings2); if (elements1.length != elements2.length) { return true; } for (int i = 0; i < elements1.length; i++) { if (!elements1[i].equals(elements2[i])) { return true; } } return false; }  Comparator commentSensitive(); @Override boolean test(List<String> strings1, List<String> strings2); }
Comparator implements BiPredicate<List<String>, List<String>> { @Override public boolean test(List<String> strings1, List<String> strings2) { if (strings1.equals(strings2)) return false; final Lexer lexer; if (checkComments) { lexer = new Lexer().commentSensitive(); } else { lexer = new Lexer(); } LexicalElement[] elements1 = lexer.apply(strings1); LexicalElement[] elements2 = lexer.apply(strings2); if (elements1.length != elements2.length) { return true; } for (int i = 0; i < elements1.length; i++) { if (!elements1[i].equals(elements2[i])) { return true; } } return false; }  Comparator commentSensitive(); @Override boolean test(List<String> strings1, List<String> strings2);  }