GitChangeType (@NotNull String statusString) { assert !statusString.isEmpty(); char c = statusString.charAt(0); for (GitChangeType changeType : values()) { if (changeType.myChar == c) { return changeType; } } throw new GitFormatException("Unexpected status [" + statusString + "]"); }