@Test public void testEquals() { assertEquals(processor1, processor3); assertFalse(processor1.equals(processor2)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Processor other = (Processor) obj; if (processorName == null) { if (other.processorName != null) { return false; } } else if (!processorName.equals(other.processorName)) { return false; } return true; }
Processor { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Processor other = (Processor) obj; if (processorName == null) { if (other.processorName != null) { return false; } } else if (!processorName.equals(other.processorName)) { return false; } return true; } }
Processor { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Processor other = (Processor) obj; if (processorName == null) { if (other.processorName != null) { return false; } } else if (!processorName.equals(other.processorName)) { return false; } return true; } Processor(String processorName); }
Processor { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Processor other = (Processor) obj; if (processorName == null) { if (other.processorName != null) { return false; } } else if (!processorName.equals(other.processorName)) { return false; } return true; } Processor(String processorName); void readUnlock(); void readLock(); void writeLock(); void writeUnlock(); void lock(boolean isWriteLock); boolean tryLock(boolean isWriteLock); void unlock(boolean isWriteUnlock); String getProcessorName(); boolean tryWriteLock(); boolean tryReadLock(); @Override int hashCode(); @Override boolean equals(Object obj); abstract boolean canBeClosed(); abstract boolean flush(); abstract void close(); abstract long memoryUsage(); }
Processor { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Processor other = (Processor) obj; if (processorName == null) { if (other.processorName != null) { return false; } } else if (!processorName.equals(other.processorName)) { return false; } return true; } Processor(String processorName); void readUnlock(); void readLock(); void writeLock(); void writeUnlock(); void lock(boolean isWriteLock); boolean tryLock(boolean isWriteLock); void unlock(boolean isWriteUnlock); String getProcessorName(); boolean tryWriteLock(); boolean tryReadLock(); @Override int hashCode(); @Override boolean equals(Object obj); abstract boolean canBeClosed(); abstract boolean flush(); abstract void close(); abstract long memoryUsage();  }