Favorites

Spare my time when using static imports ..

Window > Preferences > Java > Editor > Content Assist > Favorites:

com.google.common.collect.Lists
com.jayway.restassured.matcher.RestAssuredMatchers
com.jayway.restassured.RestAssured
io.restassured.matcher.RestAssuredMatchers
io.restassured.RestAssured
org.hamcrest.MatcherAssert
org.hamcrest.Matchers
org.mockito.Mockito
javaslang.API
javaslang.Predicates

Template to insert a static logger instance

Go Windows > Preferences > Java > Editor > Templates > New

Enter logger as name and as template:

${:import(org.slf4j.Logger,org.slf4j.LoggerFactory)}
private static final Logger LOG = LoggerFactory.getLogger(${enclosing_type}.class);

Afterwards you’re able to type logger in your code and ctrl+space gives the option to insert the logger

Template for JUnit setup method using @Before

${:import(org.junit.Before)};

@Before

public void setup() throws Exception {
  ${cursor}
}