LikeConstraint implements Constraint { public boolean isConstraintOnHostName() { return lhs.equalsIgnoreCase(HOSTNAME); } LikeConstraint(String lhs, String rhsRegex); boolean isConstraintOnHostName(); boolean matchesHostName(String hostname); boolean matchesSlaveAttributes(Collection<Attribute> attributes); @Override Type getType(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testConstraintOnHostame() throws Exception { assertTrue(constraintOne.isConstraintOnHostName()); assertTrue(constraintTwo.isConstraintOnHostName()); assertFalse(constraintThree.isConstraintOnHostName()); }