@Test public void testEquals() { PDefaultValueProvider<?> a = new PDefaultValueProvider<>(5); PDefaultValueProvider<?> b = new PDefaultValueProvider<>(5); PDefaultValueProvider<?> c = new PDefaultValueProvider<>(2); assertEquals(a, b); assertNotEquals(a, c); assertNotEquals(a, null); assertNotEquals(new Object(), a); assertEquals(a.hashCode(), b.hashCode()); assertNotEquals(a.hashCode(), c.hashCode()); }
@Override public boolean equals(Object o) { if (o == null || !(o instanceof PValueProvider)) { return false; } PValueProvider<?> other = (PValueProvider<?>) o; return value.equals(other.get()); }
PDefaultValueProvider implements PValueProvider<V> { @Override public boolean equals(Object o) { if (o == null || !(o instanceof PValueProvider)) { return false; } PValueProvider<?> other = (PValueProvider<?>) o; return value.equals(other.get()); } }
PDefaultValueProvider implements PValueProvider<V> { @Override public boolean equals(Object o) { if (o == null || !(o instanceof PValueProvider)) { return false; } PValueProvider<?> other = (PValueProvider<?>) o; return value.equals(other.get()); } PDefaultValueProvider(V value); }
PDefaultValueProvider implements PValueProvider<V> { @Override public boolean equals(Object o) { if (o == null || !(o instanceof PValueProvider)) { return false; } PValueProvider<?> other = (PValueProvider<?>) o; return value.equals(other.get()); } PDefaultValueProvider(V value); @Override V get(); @Override boolean equals(Object o); @Override int hashCode(); }
PDefaultValueProvider implements PValueProvider<V> { @Override public boolean equals(Object o) { if (o == null || !(o instanceof PValueProvider)) { return false; } PValueProvider<?> other = (PValueProvider<?>) o; return value.equals(other.get()); } PDefaultValueProvider(V value); @Override V get(); @Override boolean equals(Object o); @Override int hashCode();  }