EqualityCheck implements ReviewParticipant { @Override public Review review(PropertyFileDescriptor descriptor, Property master, Property slave) { if(master==null||slave==null) return null; String masterValue = master.getValue(); String slaveValue = slave.getValue(); if(masterValue!=null) { if(masterValue.equals(slaveValue)) { if(terminologyProvider!=null) { Map<String, Property> terminology = terminologyProvider.getTerminology(descriptor.getVariant()); Property terminologyEntry = terminology.get(slave.getValue()); if(terminologyEntry!=null && slave.getValue().equals(terminologyEntry.getValue())){ return null; } } Review review = PropertiesFactory.eINSTANCE.createReview(); review.setCreated(System.currentTimeMillis()); review.setMessage("Template and translated string are identical"); review.setReviewType(getReviewType()); review.setSeverity(Severity.WARNING); review.setUser("Jabylon"); return review; } } return null; }  @Override Review review(PropertyFileDescriptor descriptor, Property master, Property slave); @Override String getReviewType(); void bindTerminologyProvider(TerminologyProvider provider); void unbindTerminologyProvider(TerminologyProvider provider); @Override String getID(); @Override String getDescription(); @Override String getName();  }
@Test public void testIsEqual() { assertNull(getFixture().review(mock(PropertyFileDescriptor.class), createProperty("key", "value"), createProperty("key", "value1"))); assertNotNull(getFixture().review(mock(PropertyFileDescriptor.class), createProperty("key", "value"), createProperty("key", "value"))); }
@Test public void testIsEqualWithTerminology() { assertNull("equality is ok if terminology says so",getFixture().review(mock(PropertyFileDescriptor.class), createProperty("test", "test"), createProperty("test", "test"))); }