@Test public void testEquals() { assertEquals(new AtomicPositiveInteger(), new AtomicPositiveInteger()); assertEquals(new AtomicPositiveInteger(1), new AtomicPositiveInteger(1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof AtomicPositiveInteger)) return false; AtomicPositiveInteger other = (AtomicPositiveInteger) obj; return intValue() == other.intValue(); }
AtomicPositiveInteger extends Number { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof AtomicPositiveInteger)) return false; AtomicPositiveInteger other = (AtomicPositiveInteger) obj; return intValue() == other.intValue(); } }
AtomicPositiveInteger extends Number { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof AtomicPositiveInteger)) return false; AtomicPositiveInteger other = (AtomicPositiveInteger) obj; return intValue() == other.intValue(); } AtomicPositiveInteger();  AtomicPositiveInteger(int initialValue); }
AtomicPositiveInteger extends Number { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof AtomicPositiveInteger)) return false; AtomicPositiveInteger other = (AtomicPositiveInteger) obj; return intValue() == other.intValue(); } AtomicPositiveInteger();  AtomicPositiveInteger(int initialValue); final int getAndIncrement(); final int getAndDecrement(); final int incrementAndGet(); final int decrementAndGet(); final int get(); final void set(int newValue); final int getAndSet(int newValue); final int getAndAdd(int delta); final int addAndGet(int delta); final boolean compareAndSet(int expect, int update); final boolean weakCompareAndSet(int expect, int update); @Override byte byteValue(); @Override short shortValue(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
AtomicPositiveInteger extends Number { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof AtomicPositiveInteger)) return false; AtomicPositiveInteger other = (AtomicPositiveInteger) obj; return intValue() == other.intValue(); } AtomicPositiveInteger();  AtomicPositiveInteger(int initialValue); final int getAndIncrement(); final int getAndDecrement(); final int incrementAndGet(); final int decrementAndGet(); final int get(); final void set(int newValue); final int getAndSet(int newValue); final int getAndAdd(int delta); final int addAndGet(int delta); final boolean compareAndSet(int expect, int update); final boolean weakCompareAndSet(int expect, int update); @Override byte byteValue(); @Override short shortValue(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }