Category Archives: Java

WinMerge Filter for Eclipse

This filter tells WinMerge to ignore Eclipse files such as .classpath, .project, and the .metadata folder.

## This is a directory/file filter template for WinMerge
name: Eclipse
desc: Eclipse Filter

## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include

## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with " ##" and extend to the end of the line)

f: \.classpath ## Filter for filename
f: \.project ## Filter for filename
f: rebel.xml ## Filter for filename

d: \\.metadata ## Filter for directory
d: \\.settings ## Filter for directory
d: \\target ## Filter for directory
d: \\.svn ## Filter for directory

Hamcrest Matchers

public class GameChecker extends TypeSafeMatcher<MyGame>
{
	@Override
	public void describeTo(final Description description)
	{
		description.appendText("The map was not empty");
	}

	@Override
	protected boolean matchesSafely(final MyGame game)
	{
		return game.getMap().isEmpty();
	}

	@Factory
	public static Matcher<? super MyGame> isMapEmpty()
	{
		return new GameChecker();
	}
}