Code example for FieldPosition

Methods: getBeginIndex, setBeginIndex, setEndIndex

0
                fpos2.hashCode() != fpos3.hashCode());
    } 
 
    public void test_setBeginIndexI() { 
        // Test for method void java.text.FieldPosition.setBeginIndex(int) 
        FieldPosition fpos = new FieldPosition(1);
        fpos.setBeginIndex(2);
        fpos.setEndIndex(3);
        assertEquals("beginIndex should have been set to 2", 2, fpos
                .getBeginIndex());
 
        fpos.setBeginIndex(Integer.MAX_VALUE);
        assertEquals("beginIndex should have been set to Integer.MAX_VALUE",
                Integer.MAX_VALUE, fpos.getBeginIndex());
 
        fpos.setBeginIndex(-1);
        assertEquals("beginIndex should have been set to -1",
                -1, fpos.getBeginIndex());
    } 
 
    public void test_setEndIndexI() { 
        // Test for method void java.text.FieldPosition.setEndIndex(int) 
        FieldPosition fpos = new FieldPosition(1);