@Test(expected = IllegalArgumentException.class) public void testContainsWithWrongType() { choice.contains("10"); }
@Override public boolean contains(Object val) { if (min_.getClass().equals(val.getClass())) { T v = (T) val; return min_.compareTo(v) <= 0 && 0 <= max_.compareTo(v); } else { throw new IllegalArgumentException(String.format( TextHelper.LOCALE_ROOT, "type mismatch (Make sure that you specified correct Argument.type()):" + " expected: %s actual: %s", min_.getClass() .getName(), val.getClass().getName())); } }
RangeArgumentChoice implements
        ArgumentChoice { @Override public boolean contains(Object val) { if (min_.getClass().equals(val.getClass())) { T v = (T) val; return min_.compareTo(v) <= 0 && 0 <= max_.compareTo(v); } else { throw new IllegalArgumentException(String.format( TextHelper.LOCALE_ROOT, "type mismatch (Make sure that you specified correct Argument.type()):" + " expected: %s actual: %s", min_.getClass() .getName(), val.getClass().getName())); } } }
RangeArgumentChoice implements
        ArgumentChoice { @Override public boolean contains(Object val) { if (min_.getClass().equals(val.getClass())) { T v = (T) val; return min_.compareTo(v) <= 0 && 0 <= max_.compareTo(v); } else { throw new IllegalArgumentException(String.format( TextHelper.LOCALE_ROOT, "type mismatch (Make sure that you specified correct Argument.type()):" + " expected: %s actual: %s", min_.getClass() .getName(), val.getClass().getName())); } } RangeArgumentChoice(T min, T max); }
RangeArgumentChoice implements
        ArgumentChoice { @Override public boolean contains(Object val) { if (min_.getClass().equals(val.getClass())) { T v = (T) val; return min_.compareTo(v) <= 0 && 0 <= max_.compareTo(v); } else { throw new IllegalArgumentException(String.format( TextHelper.LOCALE_ROOT, "type mismatch (Make sure that you specified correct Argument.type()):" + " expected: %s actual: %s", min_.getClass() .getName(), val.getClass().getName())); } } RangeArgumentChoice(T min, T max); @Override boolean contains(Object val); @Override String textualFormat(); @Override String toString(); }
RangeArgumentChoice implements
        ArgumentChoice { @Override public boolean contains(Object val) { if (min_.getClass().equals(val.getClass())) { T v = (T) val; return min_.compareTo(v) <= 0 && 0 <= max_.compareTo(v); } else { throw new IllegalArgumentException(String.format( TextHelper.LOCALE_ROOT, "type mismatch (Make sure that you specified correct Argument.type()):" + " expected: %s actual: %s", min_.getClass() .getName(), val.getClass().getName())); } } RangeArgumentChoice(T min, T max); @Override boolean contains(Object val); @Override String textualFormat(); @Override String toString();  }