Google
 Guava
               Alex
 Korotkikh
               @alexkorotkikh
Cleaner
 code
Objects:
 hashcode
Before:
public int hashCode() {
     int result = super.hashCode();
     result = 31 * result + (amount != null ? amount.hashcode() : 0);
     result = 31 * result + (uuid != null ? uuid.hashcode() : 0);
     result = 31 * result + (channel != null ? channel.hashcode() : 0);
     result = 31 * result + (type != null ? type.hashcode() : 0);
     return result;
}
Objects:
 hashcode
Before:
public int hashCode() {
     int result = super.hashCode();
     result = 31 * result + (amount != null ? amount.hashcode() : 0);
     result = 31 * result + (uuid != null ? uuid.hashcode() : 0);
     result = 31 * result + (channel != null ? channel.hashcode() : 0);
     result = 31 * result + (type != null ? type.hashcode() : 0);
     return result;
}




After:
public int hashCode() {
    return Objects.hashCode(amount, uuid, channel, type);
}
Preconditions:
 example
Before:
public Period(Date start, Date end) {
     if (start.after(end)) {
          throw new IllegralArgumentException(Start cannot be after end);
     }
     this.start = start;
     this.end = end;
}
Preconditions:
 example
Before:
public Period(Date start, Date end) {
     if (start.after(end)) {
          throw new IllegralArgumentException(Start cannot be after end);
     }
     this.start = start;
     this.end = end;
}



After:
public Public(Date start, Date end) {
    checkArguments(start.after(end), Start cannot be after end);
    this.start = start;
    this.end = end;
}
Preconditions:
 example
 II
Before:
public Period(Date start, Date end) {
     if (start == null || end == null) {
          throw new NullPointerException(Dates cannot be null);
     }
     if (start.after(end)) {
          throw new IllegralArgumentException(Start can’t be after end);
     }
     this.start = start;
     this.end = end;
}
Preconditions:
 example
 II
Before:
public Period(Date start, Date end) {
     if (start == null || end == null) {
          throw new NullPointerException(Dates cannot be null);
     }
     if (start.after(end)) {
          throw new IllegralArgumentException(Start can’t be after end);
     }
     this.start = start;
     this.end = end;
}


After:
public Period(Date start, Date end) {
    this.start = checkNotNull(start, Start cannot be null);
    this.end = checkNotNull(end, End cannot be null);
    checkArgument(start.after(end), Start cannot be after end);
}
Preconditions:
 list
•checkNotNull
 (NullPointerException)
•checkArgument
 (IllegalArgumentException)
•checkState
 (IllegalStateException)
•checkElementIndex
 (IndexOutOfBoundsException)
•etc
Collections:
 creation
Before:
ListSomeJavaObject list = new ArrayListSomeJavaObject();
list.add(firstObj);
list.add(secondObj);

Google Guava