String[] testCaseName = { TestTransformedBuffer.class.getName()};
junit.textui.TestRunner.main(testCaseName);
}
public void testTransformedBuffer() {
Buffer buffer = TransformedBuffer.decorate(new ArrayStack(), TestTransformedCollection.STRING_TO_INTEGER_TRANSFORMER);
assertEquals(0, buffer.size());
Object[] els = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
for (int i = 0; i < els.length; i++) {
buffer.add(els[i]);
assertEquals(i + 1, buffer.size());
assertEquals(true, buffer.contains(new Integer((String) els[i])));
assertEquals(false, buffer.contains(els[i]));
}
assertEquals(false, buffer.remove(els[0]));
assertEquals(true, buffer.remove(new Integer((String) els[0])));
}