### Question:
BaseDateTimeLib { protected boolean hasOffset(String literal) { if (literal == null) { return false; } if (literal.startsWith("-") || literal.startsWith("+")) { literal = literal.substring(1); } int n = literal.length(); int index = literal.indexOf('@'); if (index != -1) { n = index; } index = literal.indexOf('['); if (index != -1) { n = index; } int offsetStartIndex = n - 6; if (0 <= offsetStartIndex && offsetStartIndex < literal.length()) { char offsetStart = literal.charAt(offsetStartIndex); if (offsetStart == '+' || offsetStart == '-') { String timeZoneOffset = literal.substring(offsetStartIndex + 1); return Character.isDigit(timeZoneOffset.charAt(0)) && Character.isDigit(timeZoneOffset.charAt(1)) && timeZoneOffset.charAt(2) == ':' && Character.isDigit(timeZoneOffset.charAt(3)) && Character.isDigit(timeZoneOffset.charAt(4)); } } return false; }   static final DateTimeFormatter FEEL_DATE_FORMAT; static final DateTimeFormatter FEEL_TIME_FORMAT; static final DateTimeFormatter FEEL_DATE_TIME_FORMAT; }### Answer:
@Test public void testHasOffset() { assertFalse(this.dateTimeLib.hasOffset("12:00:00")); assertFalse(this.dateTimeLib.hasOffset("12:00:00Z")); assertFalse(this.dateTimeLib.hasOffset("12:00:00[UTC]")); assertTrue(this.dateTimeLib.hasOffset("12:00:00+00:00")); assertTrue(this.dateTimeLib.hasOffset("12:00:00-00:00")); assertFalse(this.dateTimeLib.hasOffset("12:00:00-0000")); assertFalse(this.dateTimeLib.hasOffset("12:00:00+0000")); assertFalse(this.dateTimeLib.hasOffset("2016-08-01T12:00:00")); assertFalse(this.dateTimeLib.hasOffset("2016-08-01T12:00:00Z")); assertFalse(this.dateTimeLib.hasOffset("2016-08-01T12:00:00[UTC]")); assertTrue(this.dateTimeLib.hasOffset("2016-08-01T12:00:00+00:00")); assertTrue(this.dateTimeLib.hasOffset("2016-08-01T12:00:00-00:00")); assertTrue(this.dateTimeLib.hasOffset("-999999999-01-01T12:00:00-00:00")); assertTrue(this.dateTimeLib.hasOffset("+999999999-01-01T12:00:00-00:00")); assertFalse(this.dateTimeLib.hasOffset("2016-08-01T12:00:00-0000")); assertFalse(this.dateTimeLib.hasOffset("2016-08-01T12:00:00+0000")); }