public static String trimToNull(final String given) {
        if (given == null) {
            return null;
        }

        final String trimmed = given.trim();

        if (trimmed.isEmpty()) {
            return null;
        }

        return trimmed;
    }
@Test
    public void testTrimToNull() {
        assertEquals("abc", StringHelper.trimToNull("abc"));
        assertEquals("abc", StringHelper.trimToNull(" abc"));
        assertEquals("abc", StringHelper.trimToNull(" abc "));
        assertNull(StringHelper.trimToNull(" "));
        assertNull(StringHelper.trimToNull("\t"));
        assertNull(StringHelper.trimToNull(" \t "));
        assertNull(StringHelper.trimToNull(""));
    }