This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BrewingVat { | |
@Inject Barley barley; | |
@Inject Yeast yeast; | |
public Beer brew() { | |
//make some beer from ingredients | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Amplifier { | |
private Guitar guitar; | |
private Speaker speaker; | |
private Footpedal footpedal; | |
private Synthesizer synthesizer; | |
@Inject | |
public void set(Guitar guitar, Speaker speaker, Footpedal footpedal, | |
Synthesizer synthesizer) { | |
this.guitar = guitar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>2.12</version> | |
<configuration> | |
<redirectTestOutputToFile>true</redirectTestOutputToFile> | |
</configuration> | |
</plugin> | |
------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn -DskipTests package | |
mvn clean package | |
mvn -pl util_scripts -am -Dtest=RandomUnitTest#randomUnitTest -DfailIfNoTests=false test -Dpmd.skip=true | |
************************** | |
REMOTE DEBUG | |
By default, Maven runs your tests in a separate ("forked") process. You can use the maven.surefire.debug property to debug your forked tests remotely, like this: | |
mvn -Dmaven.surefire.debug test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make a macro (I used Organize Imports, Format Code, Save All) | |
Assign it a keystroke (I overrode ctrl+s) | |
Note: You will have to check the box "Do not show this message again" the first time for the organized imports, but it works as expected after that. | |
Step-by-step for IntelliJ 10.0: | |
Code -> "Optimize Imports...", if a dialogue box appears, check the box that says "Do not show this message again.", then click "Run". | |
Tools -> "Start Macro Recording" | |
Code -> "Optimize Imports..." | |
Code -> "Reformat Code..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.lucene.search.DocIdSet; | |
import org.apache.lucene.search.DocIdSetIterator; | |
import javax.annotation.Nullable; | |
import javax.validation.constraints.NotNull; | |
import java.io.IOException; | |
/** | |
* Negates the Given DocIdSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.lucene.search.DocIdSet; | |
import org.apache.lucene.search.DocIdSetIterator; | |
import org.apache.lucene.search.FilteredDocIdSet; | |
import javax.annotation.Nullable; | |
import javax.validation.constraints.NotNull; | |
import java.io.IOException; | |
/** | |
* AndDocIdSet |
NewerOlder