Skip to content

Instantly share code, notes, and snippets.

View jarrad's full-sized avatar

jarrad jarrad

  • NC
View GitHub Profile
@jarrad
jarrad / equals.template
Created October 30, 2015 02:19
Insert a basic equals method into your class
${:import(java.util.Objects)}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof ${enclosing_type})) {
return false;
}
${enclosing_type} other = (${enclosing_type}) obj;
@jarrad
jarrad / template
Created June 21, 2016 12:18
Eclipse Guava checkNotNull template
${:importStatic(com.google.common.base.Preconditions.checkNotNull)}${var} = checkNotNull(${var});
@jarrad
jarrad / updates.sh
Created June 22, 2016 15:15
Check for dependency updates
mvn versions:display-dependency-updates
@jarrad
jarrad / AssertExceptionLamda.java
Last active July 20, 2016 19:40
Assert an Exception was thrown in JUnit with lambdas
assertThrows(MyException.class,
() -> systemUnderTest.throwingMethod());
// now do other testy things