ExtractorName { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof ExtractorName)) { return false; } ExtractorName extractorName = (ExtractorName) object; if (!name.equals(extractorName.name)) { return false; } if (!location.equals(extractorName.location)) { return false; } return true; } private  ExtractorName(String location, String name); static ExtractorName create(String location, String name); String getLocation(); String getName(); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { ExtractorName n1 = ExtractorName.create("l1", "n1"); ExtractorName n2 = ExtractorName.create("l2", "n1"); ExtractorName n3 = ExtractorName.create("l1", "n3"); ExtractorName n4 = ExtractorName.create("l2", "n2"); ExtractorName n5 = ExtractorName.create("l1", "n1"); assertNotEquals(n1, n2); assertNotEquals(n1, n3); assertNotEquals(n1, n4); assertEquals(n1, n5); }