@Test public void toStringDoesNotUseUnderlyingData() { final BaseKey k = new TestBaseKeyImpl(new byte[]{5, 6, 7}); final BaseKey k2 = new TestBaseKeyImpl(new byte[]{5, 6, 7}); assertThat(k.toString()).isNotEqualTo(k2.toString()); }
@Override public String toString() { final String typeName = Stream.of(getClass()) .map(Class::getInterfaces) .flatMap(Stream::of) .map(Class::getName) .findFirst() .get(); return typeName + "@" + Integer.toHexString(super.hashCode()); }
BaseKey implements Key { @Override public String toString() { final String typeName = Stream.of(getClass()) .map(Class::getInterfaces) .flatMap(Stream::of) .map(Class::getName) .findFirst() .get(); return typeName + "@" + Integer.toHexString(super.hashCode()); } }
BaseKey implements Key { @Override public String toString() { final String typeName = Stream.of(getClass()) .map(Class::getInterfaces) .flatMap(Stream::of) .map(Class::getName) .findFirst() .get(); return typeName + "@" + Integer.toHexString(super.hashCode()); } protected  BaseKey(byte[] keyBytes); }
BaseKey implements Key { @Override public String toString() { final String typeName = Stream.of(getClass()) .map(Class::getInterfaces) .flatMap(Stream::of) .map(Class::getName) .findFirst() .get(); return typeName + "@" + Integer.toHexString(super.hashCode()); } protected  BaseKey(byte[] keyBytes); @Override final byte[] getKeyBytes(); @Override String encodeToBase64(); @Override final boolean equals(Object arg0); @Override final int hashCode(); @Override String toString(); }
BaseKey implements Key { @Override public String toString() { final String typeName = Stream.of(getClass()) .map(Class::getInterfaces) .flatMap(Stream::of) .map(Class::getName) .findFirst() .get(); return typeName + "@" + Integer.toHexString(super.hashCode()); } protected  BaseKey(byte[] keyBytes); @Override final byte[] getKeyBytes(); @Override String encodeToBase64(); @Override final boolean equals(Object arg0); @Override final int hashCode(); @Override String toString();  }