static <S> FieldProbe createFieldProbe(Field field, Probe probe, SourceMetadata sourceMetadata) {
        ProbeType type = getType(field.getType());
        if (type == null) {
            throw new IllegalArgumentException(format("@Probe field '%s' is of an unhandled type", field));
        }

        if (type.getMapsTo() == double.class) {
            return new DoubleFieldProbe<S>(field, probe, type, sourceMetadata);
        } else if (type.getMapsTo() == long.class) {
            return new LongFieldProbe<S>(field, probe, type, sourceMetadata);
        } else {
            throw new IllegalArgumentException(type.toString());
        }
    }
@Test(expected = IllegalArgumentException.class)
    public void whenUnknownType() throws NoSuchFieldException {
        UnknownFieldType unknownFieldType = new UnknownFieldType();
        Field field = unknownFieldType.getClass().getDeclaredField("field");
        Probe probe = field.getAnnotation(Probe.class);
        SourceMetadata ignoredSourceMetadata = new SourceMetadata(Object.class);

        createFieldProbe(field, probe, ignoredSourceMetadata);
    }