3031323334353637
} @Test(expected = ClassCastException.class) public void passingWrongTypeToErasureYieldsException() { Delegate c = new Reductor<Long, Integer>(new Count<Integer>(), 0l); c.perform(new Object()); }
9091929394959697
Assert.assertEquals(expected, got); } @Test(expected = ClassCastException.class) public void callingErasureWithWrongTypeYieldsException() { Delegate d = new Densify<Integer>(RangeMother.sequencer, RangeMother.comparator); d.perform(new Object()); }
4344454647484950
} @Test(expected = ClassCastException.class) public void consumingFromErasureWithWrongTypeYieldsException() { final Delegate cons = new ConsumeIntoCollection<ArrayList<Integer>, Integer>(new ArrayListFactory<Integer>()); cons.perform(new Object()); }
} @Test(expected = ClassCastException.class) public void consumingFromErasureWithWrongTypeYieldsException() { final StringOutputIterator output = new StringOutputIterator(); Delegate pipe = new ConsumeIntoOutputIterator(output); pipe.perform(new Object()); }
4748495051525354
} @Test(expected = ClassCastException.class) public void consumingFromErasureWithWrongTypeYieldsException() { final Delegate cons = new ConsumeIntoMap<HashMap<O, O>, O, O>(new HashMapFactory<O, O>()); cons.perform(new Object()); }
2829303132333435
} @Test(expected = ClassCastException.class) public void passingWrongTypeToErasureYieldsException() { final List<O> bucket = new ArrayList<O>(); Delegate d = new CollectionAllAdder<List<O>, O>(bucket); d.perform(new Object()); }
2021222324252627
new PredicateToDelegate<O>(null); } @Test// you probably expect this (expected = ClassCastException.class) public void passingWrongTypeToErasureJustForwardsToTheNestedAction() { Delegate d = new PredicateToDelegate<O>(new Always<O>()); d.perform(new Object()); }
new ActionToDelegate<Object>(null); } @Test// you probably expect this (expected = ClassCastException.class) public void passingWrongTypeToErasureJustForwardsToTheNestedAction() { final Delegate d = new ActionToDelegate<O>(new Noop<O>()); d.perform(new Object()); }
1920212223242526
Assert.assertFalse(got.hasValue()); } @Test(expected = ClassCastException.class) public void passingNonStringToErasureYieldsException() { Delegate d = new BooleanTryParser(); d.perform(new Object()); }
2122232425262728
new ByteTryParser(Character.MIN_RADIX - 1); } @Test(expected = ClassCastException.class) public void passingNonStringToErasureYieldsException() { Delegate d = new ByteTryParser(10); d.perform(new Object()); }