@Override
    public double readDouble(@Nonnull String fieldName) throws IOException {
        FieldDefinition fd = cd.getField(fieldName);
        if (fd == null) {
            return 0d;
        }
        switch (fd.getType()) {
            case DOUBLE:
                return super.readDouble(fieldName);
            case LONG:
                return super.readLong(fieldName);
            case FLOAT:
                return super.readFloat(fieldName);
            case INT:
                return super.readInt(fieldName);
            case BYTE:
                return super.readByte(fieldName);
            case CHAR:
                return super.readChar(fieldName);
            case SHORT:
                return super.readShort(fieldName);
            default:
                throw createIncompatibleClassChangeError(fd, DOUBLE);
        }
    }
@Test
    public void testReadDouble() throws Exception {
        double aByte = reader.readDouble("byte");
        double aShort = reader.readDouble("short");
        double aChar = reader.readDouble("char");
        double aInt = reader.readDouble("int");
        double aFloat = reader.readDouble("float");
        double aLong = reader.readDouble("long");
        double aDouble = reader.readDouble("double");

        assertEquals(1, aByte, 0);
        assertEquals(3, aShort, 0);
        assertEquals(2, aChar, 0);
        assertEquals(4, aInt, 0);
        assertEquals(5, aLong, 0);
        assertEquals(1f, aFloat, 0);
        assertEquals(2d, aDouble, 0);
        assertEquals(0, reader.readDouble("NO SUCH FIELD"), 0);
    }