@Nullable
    public static Field findPropertyField(Class<?> clazz, String fieldName) {
        Field field;
        try {
            field = clazz.getField(fieldName);
        } catch (NoSuchFieldException e) {
            return null;
        }

        if (!Modifier.isPublic(field.getModifiers()) || Modifier.isStatic(field.getModifiers())) {
            return null;
        }

        return field;
    }
@Test
    public void when_findPropertyField_nonExistent_then_returnsNull() {
        assertNull(findPropertyField(JavaFields.class, "nonExistentField"));
    }