class ErrorLookup {

    public String getLastError() {
        int lastError = kernel32.GetLastError();
        return Arrays.stream(WinError.class.getDeclaredFields()).filter(field -> {
            try {
                return Modifier.isStatic(field.getModifiers())
                        && field.getType() == int.class
                        && field.getName().startsWith("ERROR")
                        && (int) field.get(null) == lastError;
            } catch (IllegalAccessException e) {
                return false;
            }
        }).map(field -> field.getName() + "(" + lastError + ")")
                .findFirst()
                .orElse(Integer.toString(lastError));
    }

    public  ErrorLookup(Kernel32 kernel32);

}